https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dd6eb40381be1a090e413…
commit dd6eb40381be1a090e4130e6d5cdd9fea141aac9
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Jun 7 09:26:23 2020 +0200
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Jun 20 15:25:29 2020 +0200
[CMAKE] Remove work-arounds for old CMake versions. CORE-17109
---
CMakeLists.txt | 3 --
modules/rostests/winetests/msi/CMakeLists.txt | 8 ++--
sdk/cmake/gcc.cmake | 19 +++------
sdk/cmake/msvc.cmake | 56 ++++++++-------------------
4 files changed, 24 insertions(+), 62 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7f842d5ae4..4cbb6b3f190 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,9 +131,6 @@ else()
if(ENABLE_CCACHE)
message(WARNING "-- Disabling precompiled headers support (ccache).")
option(PCH "Whether to use precompiled headers" OFF)
- elseif(CMAKE_VERSION VERSION_LESS 3.16.0)
- message(WARNING "-- Disabling precompiled headers support due to this
unsupported CMake version: ${CMAKE_VERSION}.")
- option(PCH "Whether to use precompiled headers" OFF)
elseif(GCC)
message(WARNING "-- Disabling precompiled headers on GCC by default
CORE-17108.")
option(PCH "Whether to use precompiled headers" OFF)
diff --git a/modules/rostests/winetests/msi/CMakeLists.txt
b/modules/rostests/winetests/msi/CMakeLists.txt
index 279ed0b5e08..51bf9791558 100644
--- a/modules/rostests/winetests/msi/CMakeLists.txt
+++ b/modules/rostests/winetests/msi/CMakeLists.txt
@@ -34,11 +34,9 @@ list(APPEND SOURCE
list(APPEND PCH_SKIP_SOURCE
testlist.c)
-if(NOT ${CMAKE_VERSION} VERSION_LESS "3.9.0")
- # CMake 3.9 and higher requires to specify this dependency manually
- # see
https://gitlab.kitware.com/cmake/cmake/issues/19933
- set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS custom.dll)
-endif()
+# CMake 3.9 and higher requires to specify this dependency manually
+# see
https://gitlab.kitware.com/cmake/cmake/issues/19933
+set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS custom.dll)
add_executable(msi_winetest
${SOURCE}
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index b48803c7529..92d648321d4 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -266,21 +266,12 @@ if((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND
set(_compress_debug_sections_flag "-Wa,--compress-debug-sections")
endif()
-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_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 <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_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <INCLUDES>
<FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES>
<SOURCE> <OBJECT>")
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
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index cbac0fc084c..5a5a8802443 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -177,28 +177,15 @@ if(MSVC_IDE)
# For VS builds we'll only have en-US in resource files
add_definitions(/DLANGUAGE_EN_US)
else()
- if(CMAKE_VERSION VERSION_LESS 3.4.0)
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> /nologo <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()
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> /nologo <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_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> /nologo
<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()
+ 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()
@@ -207,25 +194,14 @@ if(_VS_ANALYZE_)
add_compile_flags("/analyze")
elseif(_PREFAST_)
message("PREFAST enabled!")
- 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()
+ 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()
set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})