build: find oldest macOS SDK for Mac builder
In the macOS builder script, find the oldest macOS SDK included in the Command Line Tools and use its C and C++ header directories in `CPPFLAGS` with `-isystem`. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
0c6617e920
commit
24643675c5
|
@ -86,6 +86,13 @@ if [ -n "$BREW_PREFIX" ]; then
|
|||
"$BREW_PREFIX"/bin/brew unlink gettext >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
oldest_sdk=$(find /Library/Developer/CommandLineTools/SDKs -maxdepth 1 -mindepth 1 2>/dev/null | xargs basename | sed -E 's/^MacOSX//; s/\.sdk$//' | grep -E '[[:digit:]]' | sort -V | head -1)
|
||||
|
||||
extra_includes=
|
||||
if [ -n "$oldest_sdk" ]; then
|
||||
extra_includes="-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX${oldest_sdk}.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX${oldest_sdk}.sdk/usr/include/c++/v1"
|
||||
fi
|
||||
|
||||
export BUILD_ROOT="${BUILD_ROOT:-$HOME/vbam-build-mac-${target_cpu}}$BUILD_ROOT_SUFFIX"
|
||||
|
||||
ver_file=$(mktemp)
|
||||
|
@ -126,7 +133,7 @@ export PATH="$best_llvm_path/bin:/usr/bin:/bin:/usr/sbin:/sbin:$BREW_PREFIX/bin"
|
|||
export CC="$clang_path/bin/clang"
|
||||
export CPP="$clang_path/bin/clang -E"
|
||||
export CXX="$clang_path/bin/clang++"
|
||||
export CPPFLAGS=-DICONV_CONST=
|
||||
export CPPFLAGS="-DICONV_CONST= $extra_includes"
|
||||
export CFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
|
||||
export CXXFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
|
||||
export OBJCXXFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
|
||||
|
|
Loading…
Reference in New Issue