[flang-commits] [flang] [llvm] [CMake] Support using precompiled headers with ccache in flang (PR #136856)
Michael Kruse via flang-commits
flang-commits at lists.llvm.org
Thu Apr 24 07:43:07 PDT 2025
================
@@ -452,6 +452,10 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-semantic-interposition")
endif()
+ # GCC requires this flag in order for precompiled headers to work with ccache
+ if (CMAKE_CXX_COMPILER_ID MATCHES GCC AND NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
----------------
Meinersbur wrote:
CMAKE_CXX_COMPILER_ID for GCC is ["GNU"](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html). Alsu put non-keywords/variable names in quates.
```suggestion
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
```
https://github.com/llvm/llvm-project/pull/136856
More information about the flang-commits
mailing list