[flang] [llvm] [CMake] Fix using precompiled headers with ccache (PR #131397)
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 17 10:17:52 PDT 2025
================
@@ -446,6 +446,11 @@ if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_POSIX_C_SOURCE=200809")
endif()
+# Clang requires this flag in order for precompiled headers to work with ccache.
+if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fno-pch-timestamp")
----------------
mgorny wrote:
For the record, I think it's better to have it globally. At least in Gentoo we have ccache enabled at package manager level, so having this globally would help us — and I don't think there's any harm in doing that, is there?
https://github.com/llvm/llvm-project/pull/131397
More information about the llvm-commits
mailing list