Author: tkreuzer
Date: Sun Nov 21 12:32:03 2010
New Revision: 49683
URL:
http://svn.reactos.org/svn/reactos?rev=49683&view=rev
Log:
[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
Modified:
branches/cmake-bringup/CMakeMacros.cmake
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/msc.cmake
branches/cmake-bringup/toolchain-msvc.cmake
Modified: branches/cmake-bringup/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
==============================================================================
--- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Sun Nov 21 12:32:03 2010
@@ -26,20 +26,6 @@
endif()
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)
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=496…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sun Nov 21 12:32:03 2010
@@ -33,6 +33,18 @@
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)
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=496…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Sun Nov 21 12:32:03 2010
@@ -23,6 +23,18 @@
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 @@
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
@@ -75,6 +97,14 @@
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")
set_entrypoint(${MODULE} DriverEntry@8)
@@ -86,7 +116,8 @@
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")
Modified: branches/cmake-bringup/toolchain-msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-msvc.cm…
==============================================================================
--- branches/cmake-bringup/toolchain-msvc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/toolchain-msvc.cmake [iso-8859-1] Sun Nov 21 12:32:03 2010
@@ -35,7 +35,7 @@
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")