Skip to content

Commit 451ecfe

Browse files
committed
[CMake] Warn when overriding CMAKE_DISABLE_PRECOMPILED_HEADERS
Signed-off-by: Kajetan Puchalski <[email protected]>
1 parent 6edd33b commit 451ecfe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ if(LLVM_CCACHE_BUILD)
288288
else()
289289
# Until a way to reliably configure ccache on Windows is found,
290290
# disable precompiled headers for Windows + ccache builds
291-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS "ON")
291+
if(NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
292+
message(WARNING "Using ccache with precompiled headers on Windows is currently not supported.
293+
CMAKE_DISABLE_PRECOMPILE_HEADERS will be set to ON.")
294+
set(CMAKE_DISABLE_PRECOMPILE_HEADERS "ON")
295+
endif()
292296
if(LLVM_CCACHE_MAXSIZE OR LLVM_CCACHE_DIR OR
293297
NOT LLVM_CCACHE_PARAMS MATCHES "CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros")
294298
message(FATAL_ERROR "Ccache configuration through CMake is not supported on Windows. Please use environment variables.")

0 commit comments

Comments
 (0)