File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,11 @@ if (APPLE)
446446 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_POSIX_C_SOURCE=200809" )
447447endif ()
448448
449+ # Clang requires this flag in order for precompiled headers to work with ccache.
450+ if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
451+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fno-pch-timestamp" )
452+ endif ()
453+
449454list (REMOVE_DUPLICATES CMAKE_CXX_FLAGS )
450455
451456# Determine HOST_LINK_VERSION on Darwin.
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ if(LLVM_CCACHE_BUILD)
277277 if (CCACHE_PROGRAM)
278278 set (LLVM_CCACHE_MAXSIZE "" CACHE STRING "Size of ccache" )
279279 set (LLVM_CCACHE_DIR "" CACHE STRING "Directory to keep ccached data" )
280- set (LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes CCACHE_HASHDIR=yes"
280+ set (LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros "
281281 CACHE STRING "Parameters to pass through to ccache" )
282282
283283 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
@@ -291,7 +291,7 @@ if(LLVM_CCACHE_BUILD)
291291 set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PROGRAM} )
292292 else ()
293293 if (LLVM_CCACHE_MAXSIZE OR LLVM_CCACHE_DIR OR
294- NOT LLVM_CCACHE_PARAMS MATCHES "CCACHE_CPP2=yes CCACHE_HASHDIR=yes" )
294+ NOT LLVM_CCACHE_PARAMS MATCHES "CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros " )
295295 message (FATAL_ERROR "Ccache configuration through CMake is not supported on Windows. Please use environment variables." )
296296 endif ()
297297 # RULE_LAUNCH_COMPILE should work with Ninja but currently has issues
You can’t perform that action at this time.
0 commit comments