|CMAKE] Use RULE_LAUNCH_COMPILE property to handle ccache

This commit is contained in:
Jérôme Gardou 2020-11-09 10:06:44 +01:00
parent 3acbec4851
commit bf04126e02
4 changed files with 3 additions and 14 deletions

View file

@ -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)

View file

@ -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>")

View file

@ -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)

View file

@ -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)