[Mlir-commits] [clang] [flang] [lldb] [llvm] [mlir] [cmake] Fix clang-cl PCH mismatches in static builds (PR #191552)
Alexandre Ganea
llvmlistbot at llvm.org
Tue Apr 14 06:37:50 PDT 2026
================
@@ -107,6 +107,41 @@ function(llvm_update_pch name)
set(ARG_DISABLE_PCH_REUSE ON)
endif()
+ # Certain compile definitions change macro expansion in ways that conflict
+ # with a reused PCH (e.g. visibility macros, MSVC STL config, test-only
+ # code guards). Collect both target-level and directory-level definitions
+ # and disable PCH reuse when any of these are present but absent from the
+ # PCH source. Definitions may appear as "FOO" or "FOO=value".
+ set(_pch_conflict_defs
+ LLVM_BUILD_STATIC CLANG_BUILD_STATIC
+ _ENABLE_EXTENDED_ALIGNED_STORAGE
+ MLIR_INCLUDE_TESTS FLANG_INCLUDE_TESTS)
----------------
aganea wrote:
Agreed, removed the list and moved the `MLIR_INCLUDE_TESTS` and `FLANG_INCLUDE_TESTS` on tools that actually need them. `_ENABLE_EXTENDED_ALIGNED_STORAGE` is also enabled globally now.
https://github.com/llvm/llvm-project/pull/191552
More information about the Mlir-commits
mailing list