From 5ba0e9f103c9dbd75cd30028cf7e20e655bfb94b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?=
Date: Tue, 22 Oct 2024 14:52:40 +0200
Subject: [PATCH] disabled bitcode and automatic xCode / SDK detection
---
Config.xcconfig | 8 +++-----
build.sh | 2 +-
prepare.sh | 15 ++++++++++++---
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Config.xcconfig b/Config.xcconfig
index 559baf6..a6686d5 100644
--- a/Config.xcconfig
+++ b/Config.xcconfig
@@ -32,12 +32,10 @@ MARKETING_VERSION = 0.8.0
CURRENT_PROJECT_VERSION = 3
-ARCHS = arm64 armv7 x86_64 x86_64h i386
-EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
-EXCLUDED_ARCHS[sdk=macosx*] = i386
+ARCHS = arm64 x86_64 x86_64h
SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx
-IPHONEOS_DEPLOYMENT_TARGET = 9.0
-MACOSX_DEPLOYMENT_TARGET = 10.10
+IPHONEOS_DEPLOYMENT_TARGET = 12.0
+MACOSX_DEPLOYMENT_TARGET = 11.0
SWIFT_VERSION = 4.0
diff --git a/build.sh b/build.sh
index 025b2db..cc9ae73 100755
--- a/build.sh
+++ b/build.sh
@@ -27,7 +27,7 @@
# Usage: no parameters, settings mostly defined in xcode project
#
-opts="SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES"
+opts="SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ENABLE_BITCODE=NO"
dd=./DerivedData
archivesPath="$dd/Archives"
diff --git a/prepare.sh b/prepare.sh
index 3e25169..5f7aec6 100755
--- a/prepare.sh
+++ b/prepare.sh
@@ -30,11 +30,15 @@
# - git clone of https://github.com/xiph/opus in directory ../opus
# - checked iosSDKVersion and osxSDKVersion
-iosSDKVersion="14.4"
-osxSDKVersion="11.1"
+# Get the latest installed SDK versions automatically
+iosSDKVersion=$(xcrun --sdk iphoneos --show-sdk-version)
+osxSDKVersion=$(xcrun --sdk macosx --show-sdk-version)
opusDownload="https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz"
here=$(pwd)
+mkdir opus-swift/libs
+mkdir opus-swift/include
+
rm -f opus-*.gz
wget $opusDownload
@@ -86,7 +90,12 @@ generateLibopus()
lipo -i "$tmp/$product"
}
-xcodePlatforms="/Applications/Xcode.app/Contents/Developer/Platforms"
+# Check actual xCode path
+xcodePath=$(xcode-select -p)
+
+# Set the path to the platforms
+xcodePlatforms="$xcodePath/Platforms"
+
sdkSimulator="$xcodePlatforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$iosSDKVersion.sdk"
sdkPhone="/$xcodePlatforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$iosSDKVersion.sdk"
sdkMac="/$xcodePlatforms/MacOSX.platform/Developer/SDKs/MacOSX$osxSDKVersion.sdk"