Merge pull request #11971 from Bo98/swift-sdkroot

shims: set SDKROOT for Swift
This commit is contained in:
Bo Anderson 2021-09-10 14:53:43 +01:00 committed by GitHub
commit 4d07fb9c2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Set SDKROOT to ensure it matches Homebrew's choice of SDK.
# HOMEBREW_LIBRARY is set by bin/brew
# HOMEBREW_SDKROOT is set by extend/ENV/super.rb
# shellcheck disable=SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
if [[ -z "${SDKROOT}" && -n "${HOMEBREW_SDKROOT}" ]]; then
export SDKROOT=${HOMEBREW_SDKROOT}
fi
try_exec_non_system "swift" "$@"
safe_exec "/usr/bin/swift" "$@"