mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 08:10:18 +00:00
[CMAKE]
- Add /nologo, when preprocessing asm files - Move add_pch to compiler specific files (maybe someone can fix it for MSVC) - Update set_module_type for MSVC svn path=/branches/cmake-bringup/; revision=49683
This commit is contained in:
parent
822496fa61
commit
26718d757e
4 changed files with 48 additions and 19 deletions
|
@ -27,20 +27,6 @@ MACRO(_PCH_GET_COMPILE_FLAGS _target_name _out_compile_flags _header_filename)
|
|||
|
||||
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
|
||||
|
||||
MACRO(add_pch _target_name _header_filename _src_list)
|
||||
|
||||
get_filename_component(FILE ${_header_filename} NAME)
|
||||
set(_gch_filename "${_target_name}_${FILE}.gch")
|
||||
list(APPEND ${_src_list} ${_gch_filename})
|
||||
_PCH_GET_COMPILE_FLAGS(${_target_name} _args ${_header_filename})
|
||||
file(REMOVE ${_gch_filename})
|
||||
add_custom_command(
|
||||
OUTPUT ${_gch_filename}
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${_args}
|
||||
DEPENDS ${_header_filename})
|
||||
|
||||
ENDMACRO(add_pch _target_name _header_filename _src_list)
|
||||
|
||||
if (NOT MSVC)
|
||||
MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
|
||||
|
|
12
gcc.cmake
12
gcc.cmake
|
@ -33,6 +33,18 @@ add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-e
|
|||
add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
|
||||
|
||||
# Macros
|
||||
MACRO(add_pch _target_name _header_filename _src_list)
|
||||
get_filename_component(FILE ${_header_filename} NAME)
|
||||
set(_gch_filename "${_target_name}_${FILE}.gch")
|
||||
list(APPEND ${_src_list} ${_gch_filename})
|
||||
_PCH_GET_COMPILE_FLAGS(${_target_name} _args ${_header_filename})
|
||||
file(REMOVE ${_gch_filename})
|
||||
add_custom_command(
|
||||
OUTPUT ${_gch_filename}
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${_args}
|
||||
DEPENDS ${_header_filename})
|
||||
ENDMACRO(add_pch _target_name _header_filename _src_list)
|
||||
|
||||
macro(add_linkerflag MODULE _flag)
|
||||
set(NEW_LINKER_FLAGS ${_flag})
|
||||
get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
|
||||
|
|
39
msc.cmake
39
msc.cmake
|
@ -23,6 +23,18 @@ link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3r
|
|||
|
||||
set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||
|
||||
MACRO(add_pch _target_name _header_filename _src_list)
|
||||
get_filename_component(FILE ${_header_filename} NAME)
|
||||
set(_gch_filename "${_target_name}_${FILE}.gch")
|
||||
list(APPEND ${_src_list} ${_gch_filename})
|
||||
_PCH_GET_COMPILE_FLAGS(${_target_name} _args ${_header_filename})
|
||||
file(REMOVE ${_gch_filename})
|
||||
add_custom_command(
|
||||
OUTPUT ${_gch_filename}
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${_args}
|
||||
DEPENDS ${_header_filename})
|
||||
ENDMACRO(add_pch _target_name _header_filename _src_list)
|
||||
|
||||
macro(add_linkerflag MODULE _flag)
|
||||
set(NEW_LINKER_FLAGS ${_flag})
|
||||
get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)
|
||||
|
@ -52,17 +64,27 @@ macro(set_module_type MODULE TYPE)
|
|||
add_dependencies(${MODULE} psdk buildno_header)
|
||||
if(${TYPE} MATCHES nativecui)
|
||||
set_subsystem(${MODULE} native)
|
||||
add_importlibs(${MODULE} ntdll)
|
||||
set_entrypoint(${MODULE} NtProcessStartup@4)
|
||||
endif()
|
||||
if (${TYPE} MATCHES win32gui)
|
||||
set_subsystem(${MODULE} windows)
|
||||
set_entrypoint(${MODULE} WinMainCRTStartup)
|
||||
target_link_libraries(${MODULE} mingw_common mingw_wmain)
|
||||
if(IS_UNICODE)
|
||||
target_link_libraries(${MODULE} mingw_wmain)
|
||||
else()
|
||||
target_link_libraries(${MODULE} mingw_main)
|
||||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common)
|
||||
endif ()
|
||||
if (${TYPE} MATCHES win32cui)
|
||||
set_subsystem(${MODULE} console)
|
||||
set_entrypoint(${MODULE} mainCRTStartup)
|
||||
target_link_libraries(${MODULE} mingw_common mingw_wmain)
|
||||
if(IS_UNICODE)
|
||||
target_link_libraries(${MODULE} mingw_wmain)
|
||||
else()
|
||||
target_link_libraries(${MODULE} mingw_main)
|
||||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common)
|
||||
endif ()
|
||||
if(${TYPE} MATCHES win32dll)
|
||||
# Need this only because mingw library is broken
|
||||
|
@ -74,6 +96,14 @@ macro(set_module_type MODULE TYPE)
|
|||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common mingw_dllmain)
|
||||
add_linkerflag(${MODULE} "/DLL")
|
||||
endif()
|
||||
if(${TYPE} MATCHES win32ocx)
|
||||
set_entrypoint(${MODULE} DllMain@12)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
|
||||
endif()
|
||||
if(${TYPE} MATCHES cpl)
|
||||
set_entrypoint(${MODULE} DllMain@12)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
|
||||
endif()
|
||||
if(${TYPE} MATCHES kernelmodedriver)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
|
||||
|
@ -86,7 +116,8 @@ macro(set_module_type MODULE TYPE)
|
|||
endmacro()
|
||||
|
||||
macro(set_unicode)
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
set(IS_UNICODE 1)
|
||||
endmacro()
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
|
||||
|
|
|
@ -35,7 +35,7 @@ SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /I${REACTOS_SOURCE_DI
|
|||
SET(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> /win32 /Dstrict_context_handle= /h <OBJECT> <SOURCE>")
|
||||
|
||||
SET(CMAKE_ASM_COMPILE_OBJECT
|
||||
"<CMAKE_C_COMPILER> /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
|
||||
"<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
|
||||
"<CMAKE_ASM_COMPILER> /nologo /Fo<OBJECT> /c /Ta <OBJECT>.tmp")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W1 /Zm1000")
|
||||
|
|
Loading…
Reference in a new issue