Improve superenv mixing newer LLVM headers with Apple libc++

To avoid missing symbols when mixing newer LLVM headers with older Apple
libc++, inject a __config_site that sets vendor availability annotations
to match system library.
This commit is contained in:
Michael Cho 2025-09-08 19:22:17 -04:00
parent 6c44d1a8f1
commit 4077e8e38d
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#ifndef _HOMEBREW_LIBCPP___CONFIG_SITE
#define _HOMEBREW_LIBCPP___CONFIG_SITE
#include_next <__config_site>
#define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 1
#endif // _HOMEBREW_LIBCPP___CONFIG_SITE

View File

@ -324,6 +324,9 @@ class Cmd
args << "-std=c++11" if cxx11? args << "-std=c++11" if cxx11?
args << "-stdlib=libc++" if libcxx? args << "-stdlib=libc++" if libcxx?
args << "-stdlib=libstdc++" if libstdcxx? args << "-stdlib=libstdc++" if libstdcxx?
if ENV["HOMEBREW_CC"] == "llvm_clang" && mac?
args << "-I#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/shims/mac/super/include/llvm"
end
args args
end end