From bf04126e025fdcabe360822d3d2fbc68b1841a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 9 Nov 2020 10:06:44 +0100 Subject: [PATCH] |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} ${_compress_debug_sections_flag} -o -c ") +set(CMAKE_C_COMPILE_OBJECT " ${_compress_debug_sections_flag} -o -c ") # FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to CXX too -set(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} -o -c ") +set(CMAKE_CXX_COMPILE_OBJECT " -o -c ") set(CMAKE_ASM_COMPILE_OBJECT " ${_compress_debug_sections_flag} -x assembler-with-cpp -o -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm -D__ASM__ -c ") set(CMAKE_RC_COMPILE_OBJECT " -O coff -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} ") 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)