shims/mac/super/xcrun: use Homebrew's chosen SDK and DEVELOPER_DIR
Fixes #7250.
This commit is contained in:
parent
c1708ff6b9
commit
99550ff564
@ -109,6 +109,11 @@ module Superenv
|
|||||||
def setup_build_environment(formula = nil)
|
def setup_build_environment(formula = nil)
|
||||||
generic_setup_build_environment(formula)
|
generic_setup_build_environment(formula)
|
||||||
self["HOMEBREW_SDKROOT"] = effective_sysroot
|
self["HOMEBREW_SDKROOT"] = effective_sysroot
|
||||||
|
self["HOMEBREW_DEVELOPER_DIR"] = if MacOS::CLT.installed? && MacOS::CLT.provides_sdk?
|
||||||
|
MacOS::CLT::PKG_PATH
|
||||||
|
else
|
||||||
|
MacOS::Xcode.prefix
|
||||||
|
end
|
||||||
|
|
||||||
# Filter out symbols known not to be defined since GNU Autotools can't
|
# Filter out symbols known not to be defined since GNU Autotools can't
|
||||||
# reliably figure this out with Xcode 8 and above.
|
# reliably figure this out with Xcode 8 and above.
|
||||||
|
|||||||
@ -1,10 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Historically, xcrun has had various bugs, and in some cases it didn't
|
# Historically, xcrun has had various bugs, and in some cases it didn't
|
||||||
# work at all (e.g. CLT-only in the Xcode 4.3 era). This script emulates
|
# work at all (e.g. CLT-only in the Xcode 4.3 era). This script emulates
|
||||||
# it and attempts to avoid these issues.
|
# it and attempts to avoid these issues.
|
||||||
|
|
||||||
# Some build tools set DEVELOPER_DIR, so discard it
|
# SDKROOT is not used if `--sdk` is supplied.
|
||||||
unset DEVELOPER_DIR
|
# We however don't want to interrupt other uses like `xcrun --find clang`.
|
||||||
|
if [[ "$*" =~ (^| )-?-sdk ]]; then
|
||||||
|
export DEVELOPER_DIR=$HOMEBREW_DEVELOPER_DIR
|
||||||
|
else
|
||||||
|
# Some build tools set DEVELOPER_DIR, so discard it
|
||||||
|
unset DEVELOPER_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SDKROOT" ]; then
|
||||||
|
export SDKROOT=$HOMEBREW_SDKROOT
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
exec /usr/bin/xcrun "$@"
|
exec /usr/bin/xcrun "$@"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user