[llvm] [libc++] Use private CMake flags to enable the pragma system_header macro when building (PR #138826)
Louis Dionne via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 14:47:05 PST 2025
ldionne wrote:
You should build it using the instructions here https://libcxx.llvm.org/VendorDocumentation.html#the-default-build, and once you've installed the library, link against it by using the appropriate Clang flags (`-nostdinc++ -isystem <install>/include/c++/v1 -nostdlib++ -L <install>/lib -lc++ -Wl,-rpath,<install>/lib` or something like that). You could do that for example by using a CMake external project that drives the libc++ build as documented, and then using an interface target that depends on it and sets up the right compiler and linker flags as above.
That way, you're considering the libc++ build as a hermetic black box and only using the documented and officially supported aspects of it.
https://github.com/llvm/llvm-project/pull/138826
More information about the llvm-commits
mailing list