[flang] [llvm] [CMake] Fix using precompiled headers with ccache (PR #131397)

Tom Eccles via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 06:59:42 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")
----------------
tblah wrote:

Another thought, how recent is clang's PCH support? Is -fno-pch-timestamp supported on all versions of clang supported by LLVM?

https://github.com/llvm/llvm-project/pull/131397


More information about the llvm-commits mailing list