macOS: `-mmacosx-version-min` is required for setting min version (#1192)

* Set `MACOSX_DEPLOYMENT_TARGET` also
This commit is contained in:
vkedwardli 2022-11-10 14:16:28 +08:00 committed by GitHub
parent acebbfd88a
commit 1590be8c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -108,8 +108,17 @@ main() {
fi fi
if [[ $CROSS_ARCH != "" ]]; then if [[ $CROSS_ARCH != "" ]]; then
if [[ $platform == "macos" && $CROSS_ARCH == "arm64" ]]; then if [[ $platform == "macos" ]]; then
macos_version_min=10.11
if [[ $CROSS_ARCH == "arm64" ]]; then
cross_file="--cross-file resources/macos/macos_arm64.conf" cross_file="--cross-file resources/macos/macos_arm64.conf"
macos_version_min=11.0
fi
export MACOSX_DEPLOYMENT_TARGET=$macos_version_min
export MIN_SUPPORTED_MACOSX_DEPLOYMENT_TARGET=$macos_version_min
export CFLAGS=-mmacosx-version-min=$macos_version_min
export CXXFLAGS=-mmacosx-version-min=$macos_version_min
export LDFLAGS=-mmacosx-version-min=$macos_version_min
fi fi
fi fi