[clang] [clang][driver] Add \<executable\>/../include/c++/v1 to include path on Darwin (PR #70817)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 13:54:17 PST 2023


================
@@ -2494,6 +2494,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
                    << "\"\n";
----------------
ldionne wrote:

Please update the documentation above:

```
// On Darwin, libc++ can be installed in one of the following places:
// 1. Alongside the compiler in         <install>/include/c++/v1
// 2. Alongside the compiler in         <clang-executable-location>/../include/c++/v1
// 3. In a SDK (or a custom sysroot) in <sysroot>/usr/include/c++/v1
//
// The precedence of paths is as listed above, i.e. we take the first path
// that exists. Note that we never include libc++ twice -- we take the first
// path that exists and don't send the other paths to CC1 (otherwise 
// include_next could break).
//
// Also note that in most cases, (1) and (2) are exactly the same path.
// Those two paths will differ only when the `clang` program being run
// is actually a symlink to the real executable.
```

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


More information about the cfe-commits mailing list