https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf04126e025fdcabe3608…
commit bf04126e025fdcabe360822d3d2fbc68b1841a50
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Nov 9 10:06:44 2020 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Mon Nov 9 10:47:19 2020 +0100
|CMAKE] Use RULE_LAUNCH_COMPILE property to handle ccache
---
CMakeLists.txt | 1 +
sdk/cmake/gcc.cmake | 4 ++--
toolchain-clang.cmake | 6 ------
toolchain-gcc.cmake | 6 ------
4 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f81d9274381..103b1c5bf90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,6 +161,7 @@ Enable this if the module uses typeid or dynamic_cast. You will
probably need to
if(ENABLE_CCACHE)
message(WARNING "-- Disabling precompiled headers support (ccache).")
option(PCH "Whether to use precompiled headers" OFF)
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
elseif(GCC)
message(WARNING "-- Disabling precompiled headers on GCC by default
CORE-17108.")
option(PCH "Whether to use precompiled headers" OFF)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index 216c24c54a4..5fac4f059f4 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -246,9 +246,9 @@ if((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND
set(_compress_debug_sections_flag "-Wa,--compress-debug-sections")
endif()
-set(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES>
${_compress_debug_sections_flag} <INCLUDES> <FLAGS> -o <OBJECT> -c
<SOURCE>")
+set(CMAKE_C_COMPILE_OBJECT "<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_CXX_COMPILE_OBJECT "<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>")
diff --git a/toolchain-clang.cmake b/toolchain-clang.cmake
index af3caeccda4..da3ffc782e7 100644
--- a/toolchain-clang.cmake
+++ b/toolchain-clang.cmake
@@ -24,12 +24,6 @@ if(NOT DEFINED MINGW_TOOLCHAIN_SUFFIX)
set(MINGW_TOOLCHAIN_SUFFIX "" CACHE STRING "MinGW Toolchain
Suffix")
endif()
-if(ENABLE_CCACHE)
- set(CCACHE "ccache" CACHE STRING "ccache")
-else()
- set(CCACHE "" CACHE STRING "ccache")
-endif()
-
# The name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)
diff --git a/toolchain-gcc.cmake b/toolchain-gcc.cmake
index d2801733ec4..276225ec663 100644
--- a/toolchain-gcc.cmake
+++ b/toolchain-gcc.cmake
@@ -30,12 +30,6 @@ if(NOT DEFINED MINGW_TOOLCHAIN_SUFFIX)
set(MINGW_TOOLCHAIN_SUFFIX "" CACHE STRING "MinGW Toolchain
Suffix")
endif()
-if(ENABLE_CCACHE)
- set(CCACHE "ccache" CACHE STRING "ccache")
-else()
- set(CCACHE "" CACHE STRING "ccache")
-endif()
-
# The name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)