[llvm] [cmake] Restore exception flags in llvm-config --cxxflags (PR #176195)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 15 08:33:50 PST 2026


https://github.com/aengelke approved this pull request.

LGTM. The whole thing is just incredibly messy and if this causes breakage, let's not try to win points for purity here.

A summary of the messiness:

- -fno-exceptions/-fno-rtti are only exposed via llvm-config, not via CMake when linking against LLVM. CMake users have to add these manually.
- CMake by-default adds `/EHsc` for MSVC (`/GR` was dropped with CMake 3.20, which we require).
- MSVC warns about option mismatch, this warning can't be disabled.
- Two unittests unconditionally want exceptions, with MSVC this forces us to do this per-target flag update and prevent us from just setting it in the global CMAKE_CXX_FLAGS.
- Many Linux distributions build with -frtti, because some users use rtti to avoid this incompatibility.


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


More information about the llvm-commits mailing list