Prioritize 'zlib from xcode sdk' flag correctly (#2791)

All include directories should go into CPPFLAGS.
XCode SDK was being added to CFLAGS instead
which caused old Tcl/Tk in the SDK to override a newer one in Homebrew.
This commit is contained in:
native-api 2023-09-18 00:46:59 +03:00 committed by GitHub
parent c844b332ca
commit d2c4d963d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1616,7 +1616,7 @@ use_xcode_sdk_zlib() {
local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)" local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)"
if [ -d "$xc_sdk_path" ]; then if [ -d "$xc_sdk_path" ]; then
echo "python-build: use zlib from xcode sdk" echo "python-build: use zlib from xcode sdk"
export CFLAGS="${CFLAGS:+$CFLAGS }-I${xc_sdk_path}/usr/include" export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${xc_sdk_path}/usr/include"
if is_mac -ge 1100; then if is_mac -ge 1100; then
export LDFLAGS="${LDFLAGS:+$LDFLAGS }-L${xc_sdk_path}/usr/lib" export LDFLAGS="${LDFLAGS:+$LDFLAGS }-L${xc_sdk_path}/usr/lib"
fi fi