Author: tkreuzer
Date: Sun Sep 19 23:03:25 2010
New Revision: 48824
URL:
http://svn.reactos.org/svn/reactos?rev=48824&view=rev
Log:
[CMAKE]
- Improved MSVC toolchain support, now working with WDK, as well
(Thanks to Amine for solving the problems)
- Add compiler specific macro set_subsystem
- add nativecui module type
Modified:
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/msc.cmake
branches/cmake-bringup/toolchain-msvc.cmake
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=488…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sun Sep 19 23:03:25 2010
@@ -37,6 +37,10 @@
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,-entry,_${ENTRYPOINT}")
endmacro()
+macro(set_subsystem MODULE SUBSYSTEM)
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,--subsystem:${SUBSYSTEM}")
+endmacro()
+
macro(add_importlibs MODULE)
FOREACH(LIB ${ARGN})
target_link_libraries(${MODULE} ${LIB}.a)
@@ -45,7 +49,12 @@
macro(set_module_type MODULE TYPE)
target_link_libraries(${MODULE} mingw_wmain mingw_common)
+ if(${TYPE} MATCHES nativecui)
+ set_subsystem(${MODULE} native)
+ set_entrypoint(${MODULE} NtProcessStartup@4)
+ endif()
if(${TYPE} MATCHES win32gui)
+ set_subsystem(${MODULE} windows)
set_entrypoint(${MODULE} wWinMainCRTStartup)
endif()
endmacro()
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=488…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Sun Sep 19 23:03:25 2010
@@ -18,6 +18,10 @@
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"/ENTRY:${ENTRYPOINT}")
endmacro()
+macro(set_subsystem MODULE SUBSYSTEM)
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"/subsystem:${SUBSYSTEM}")
+endmacro()
+
macro(add_importlibs MODULE)
FOREACH(LIB ${ARGN})
target_link_libraries(${MODULE} ${LIB}.LIB)
@@ -25,9 +29,17 @@
endmacro()
macro(set_module_type MODULE TYPE)
+ if(${TYPE} MATCHES nativecui)
+ set_subsystem(${MODULE} native)
+ add_importlibs(${MODULE} ntdll)
+ endif()
if (${TYPE} MATCHES win32gui)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"/subsystem:windows")
+ set_subsystem(${MODULE} windows)
endif ()
endmacro()
endif()
+
+set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
+SET(CMAKE_CXX_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 Sep 19 23:03:25 2010
@@ -1,7 +1,24 @@
if(NOT ARCH)
-set(ARCH i386)
-endif(NOT ARCH)
+ set(ARCH i386)
+endif()
+
+# WDK support
+string(REPLACE * ${ARCH} ATL_LIB_PATH $ENV{ATL_LIB_PATH})
+string(REPLACE * ${ARCH} CRT_LIB_PATH $ENV{CRT_LIB_PATH})
+string(REPLACE * ${ARCH} DDK_LIB_PATH $ENV{DDK_LIB_PATH})
+string(REPLACE * ${ARCH} KMDF_LIB_PATH $ENV{KMDF_LIB_PATH})
+string(REPLACE * ${ARCH} MFC_LIB_PATH $ENV{MFC_LIB_PATH})
+string(REPLACE * ${ARCH} SDK_LIB_PATH $ENV{SDK_LIB_PATH})
+
+link_directories(
+#${ATL_LIB_PATH}
+ ${CRT_LIB_PATH}
+ ${DDK_LIB_PATH}
+# ${IFSKIT_LIB_PATH}
+# ${KMDF_LIB_PATH}
+# ${MFC_LIB_PATH}
+ ${SDK_LIB_PATH})
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
@@ -16,7 +33,12 @@
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES>
/I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/psdk
/I${REACTOS_SOURCE_DIR}/include/ /I${REACTOS_SOURCE_DIR}/include/reactos
/I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/wine
/I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/crt/mingw32 /fo
<OBJECT> <SOURCE>")
set(CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W1 /Zm1000")
+set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
+SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# Prevent from using run time checking when testing the compiler
+set(CMAKE_BUILD_TYPE "RelwithDebInfo" CACHE STRING "Build Type")