Skip to content

Commit 1429560

Browse files
committed
[CMake] Make precompiled headers opt-in for ccache builds
Using precompiled headers in ccache builds seems to be causing intermittent CI failures where CMake fails to rebuild the header when it's supposed to, such as: https://www.mail-archive.com/[email protected]/msg88645.html Add a new LLVM_CCACHE_PCH option, set to OFF by default, in order to make using pch in ccache opt-in and avoid these failures in the CI. Signed-off-by: Kajetan Puchalski <[email protected]>
1 parent 6421248 commit 1429560

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ if(LLVM_CCACHE_BUILD)
289289
set(LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros"
290290
CACHE STRING "Parameters to pass through to ccache")
291291

292+
# Using precompiled headers with ccache builds can result in intermittent CI failures
293+
set(LLVM_CCACHE_PCH OFF CACHE BOOL "Use precompiled headers in ccache builds")
294+
if (NOT LLVM_CCACHE_PCH)
295+
set(CMAKE_DISABLE_PRECOMPILE_HEADERS "ON")
296+
endif()
297+
292298
if(NOT CMAKE_HOST_WIN32)
293299
set(CCACHE_PROGRAM "${LLVM_CCACHE_PARAMS} ${CCACHE_PROGRAM}")
294300
if (LLVM_CCACHE_MAXSIZE)

0 commit comments

Comments
 (0)