Swiftgram/third-party/libvpx/0001-Support-arm64-simulator.patch
2021-05-17 02:22:11 +04:00

70 lines
2.4 KiB
Diff

From 75cd2d63c8f39466706fcf635ddffa4686968a33 Mon Sep 17 00:00:00 2001
From: Ali <>
Date: Mon, 17 May 2021 02:17:45 +0400
Subject: [PATCH] Support arm64 iOS simulator
---
build/make/configure.sh | 18 ++++++++++++++----
configure | 1 +
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 81d30a16c..eb15e4b07 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1095,9 +1095,14 @@ EOF
soft_enable unit_tests
;;
- darwin)
+ darwin|iphonesimulator)
if ! enabled external_build; then
- XCRUN_FIND="xcrun --sdk iphoneos --find"
+ sdk_platform_name="iphoneos"
+ if [ "${tgt_os}" == "iphonesimulator" ]; then
+ sdk_platform_name="iphonesimulator"
+ fi
+
+ XCRUN_FIND="xcrun --sdk $sdk_platform_name --find"
CXX="$(${XCRUN_FIND} clang++)"
CC="$(${XCRUN_FIND} clang)"
AR="$(${XCRUN_FIND} ar)"
@@ -1116,7 +1121,12 @@ EOF
add_cflags -arch ${tgt_isa}
add_ldflags -arch ${tgt_isa}
- alt_libc="$(show_darwin_sdk_path iphoneos)"
+ if [ "${tgt_os}" == "iphonesimulator" ]; then
+ add_cflags --target=arm64-apple-ios7.0-simulator
+ add_ldflags --target=arm64-apple-ios7.0-simulator
+ fi
+
+ alt_libc="$(show_darwin_sdk_path $sdk_platform_name)"
if [ -d "${alt_libc}" ]; then
add_cflags -isysroot ${alt_libc}
fi
@@ -1145,7 +1155,7 @@ EOF
;;
esac
- if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
+ if [ "$(show_darwin_sdk_major_version $sdk_platform_name)" -gt 8 ]; then
check_add_cflags -fembed-bitcode
check_add_asflags -fembed-bitcode
check_add_ldflags -fembed-bitcode
diff --git a/configure b/configure
index da631a45e..1c6042038 100755
--- a/configure
+++ b/configure
@@ -100,6 +100,7 @@ EOF
all_platforms="${all_platforms} arm64-android-gcc"
all_platforms="${all_platforms} arm64-darwin-gcc"
all_platforms="${all_platforms} arm64-darwin20-gcc"
+all_platforms="${all_platforms} arm64-iphonesimulator-gcc"
all_platforms="${all_platforms} arm64-linux-gcc"
all_platforms="${all_platforms} arm64-win64-gcc"
all_platforms="${all_platforms} arm64-win64-vs15"
--
2.30.1 (Apple Git-130)