Author: tfaber
Date: Sun Nov 13 10:19:22 2016
New Revision: 73220
URL:
http://svn.reactos.org/svn/reactos?rev=73220&view=rev
Log:
[CMAKE]
- Use CMake 3.4's <INCLUDES> rule variable in addition to <FLAGS>.
CORE-12373 #resolve
Modified:
trunk/reactos/sdk/cmake/Compiler/GNU.cmake
trunk/reactos/sdk/cmake/Platform/Windows-MSVC.cmake
trunk/reactos/sdk/cmake/gcc.cmake
trunk/reactos/sdk/cmake/msvc.cmake
Modified: trunk/reactos/sdk/cmake/Compiler/GNU.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/Compiler/GNU.cma…
==============================================================================
--- trunk/reactos/sdk/cmake/Compiler/GNU.cmake [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/Compiler/GNU.cmake [iso-8859-1] Sun Nov 13 10:19:22 2016
@@ -50,8 +50,13 @@
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "")
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
- set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ else()
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> >
<PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER>
<DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o
<ASSEMBLY_SOURCE>")
+ endif()
if(NOT APPLE)
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
endif()
Modified: trunk/reactos/sdk/cmake/Platform/Windows-MSVC.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/Platform/Windows…
==============================================================================
--- trunk/reactos/sdk/cmake/Platform/Windows-MSVC.cmake [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/Platform/Windows-MSVC.cmake [iso-8859-1] Sun Nov 13 10:19:22
2016
@@ -59,7 +59,11 @@
# make sure to enable languages after setting configuration types
enable_language(RC)
-set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT>
<SOURCE>")
+if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT>
<SOURCE>")
+else()
+ set(CMAKE_COMPILE_RESOURCE "rc <INCLUDES> <FLAGS> /fo<OBJECT>
<SOURCE>")
+endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(MSVC_IDE 1)
@@ -224,12 +228,21 @@
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib
${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
- set(CMAKE_${lang}_COMPILE_OBJECT
- "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT>
/Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
- set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
- "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS>
<DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
- set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs
/Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT>
/Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS>
<DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs
/Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ else()
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES> <FLAGS> <DEFINES>
/Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES>
<FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE}
${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES> <FLAGS> <DEFINES>
/FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ endif()
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_LINK_EXECUTABLE
Modified: trunk/reactos/sdk/cmake/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/gcc.cmake?rev=73…
==============================================================================
--- trunk/reactos/sdk/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/gcc.cmake [iso-8859-1] Sun Nov 13 10:19:22 2016
@@ -256,12 +256,21 @@
set(_compress_debug_sections_flag "-Wa,--compress-debug-sections")
endif()
-set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES>
${_compress_debug_sections_flag} <FLAGS> -o <OBJECT> -c <SOURCE>")
-# FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to CXX
too
-set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES>
<FLAGS> -o <OBJECT> -c <SOURCE>")
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER>
${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT>
-I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
-
-set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS>
-DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE>
<OBJECT>")
+if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES>
${_compress_debug_sections_flag} <FLAGS> -o <OBJECT> -c <SOURCE>")
+ # FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to
CXX too
+ set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER>
<DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER>
${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT>
-I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
+
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS>
-DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE>
<OBJECT>")
+else()
+ set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES>
${_compress_debug_sections_flag} <INCLUDES> <FLAGS> -o <OBJECT> -c
<SOURCE>")
+ # FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to
CXX too
+ set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER>
<DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER>
${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT>
-I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm
<INCLUDES> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
+
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <INCLUDES>
<FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES>
<SOURCE> <OBJECT>")
+endif()
set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor
\"${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX} -E -xc-header -MMD -MF
<DEPFILE> -MT <OBJECT>\" ")
# Optional 3rd parameter: stdcall stack bytes
Modified: trunk/reactos/sdk/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/msvc.cmake?rev=7…
==============================================================================
--- trunk/reactos/sdk/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/msvc.cmake [iso-8859-1] Sun Nov 13 10:19:22 2016
@@ -140,15 +140,28 @@
else()
set(rc_nologo_flag)
endif()
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag}
<FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
- if(ARCH STREQUAL "arm")
- set(CMAKE_ASM_COMPILE_OBJECT
- "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> >
<OBJECT>.tmp"
- "<CMAKE_ASM_COMPILER> -nologo -o <OBJECT>
<OBJECT>.tmp")
- else()
- set(CMAKE_ASM_COMPILE_OBJECT
- "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> >
<OBJECT>.tmp"
- "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta
<OBJECT>.tmp")
+ if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag}
<FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
+ if(ARCH STREQUAL "arm")
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> >
<OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> -nologo -o <OBJECT>
<OBJECT>.tmp")
+ else()
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> >
<OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta
<OBJECT>.tmp")
+ endif()
+ else()
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag}
<INCLUDES> <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT>
<SOURCE>")
+ if(ARCH STREQUAL "arm")
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<INCLUDES> <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE>
> <OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> -nologo -o <OBJECT>
<OBJECT>.tmp")
+ else()
+ set(CMAKE_ASM_COMPILE_OBJECT
+ "cl ${cl_includes_flag} /nologo /X
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm
<INCLUDES> <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE>
> <OBJECT>.tmp"
+ "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta
<OBJECT>.tmp")
+ endif()
endif()
endif()
@@ -157,14 +170,25 @@
add_compile_flags("/analyze")
elseif(_PREFAST_)
message("PREFAST enabled!")
- set(CMAKE_C_COMPILE_OBJECT "prefast <CMAKE_C_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES>
/Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
- "prefast LIST")
- set(CMAKE_CXX_COMPILE_OBJECT "prefast <CMAKE_CXX_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP
/Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
- "prefast LIST")
- set(CMAKE_C_LINK_EXECUTABLE
- "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_C_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
- set(CMAKE_CXX_LINK_EXECUTABLE
- "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ if(CMAKE_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_C_COMPILE_OBJECT "prefast <CMAKE_C_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES>
/Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
+ "prefast LIST")
+ set(CMAKE_CXX_COMPILE_OBJECT "prefast <CMAKE_CXX_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP
/Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
+ "prefast LIST")
+ set(CMAKE_C_LINK_EXECUTABLE
+ "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_C_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_CXX_LINK_EXECUTABLE
+ "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ else()
+ set(CMAKE_C_COMPILE_OBJECT "prefast <CMAKE_C_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <INCLUDES> <FLAGS> <DEFINES>
/Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
+ "prefast LIST")
+ set(CMAKE_CXX_COMPILE_OBJECT "prefast <CMAKE_CXX_COMPILER>
${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <INCLUDES> <FLAGS> <DEFINES>
/TP /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}"
+ "prefast LIST")
+ set(CMAKE_C_LINK_EXECUTABLE
+ "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <INCLUDES> <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_C_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_CXX_LINK_EXECUTABLE
+ "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS>
${CMAKE_START_TEMP_FILE} <INCLUDES> <FLAGS> /Fe<TARGET> -link
/implib:<TARGET_IMPLIB>
/version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>
<CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>
<LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ endif()
endif()
set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})