Skip to content

Commit

Permalink
fix: Add Mac Catalyst support (#3767)
Browse files Browse the repository at this point in the history
Our pre-built solution had no support for mac-catalyst

Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
  • Loading branch information
brustolin and philipphofmann committed Mar 19, 2024
1 parent f79ec31 commit 8aba9c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fix runtime error when including Sentry as a static lib (#3764)
- Fix Mac Catalyst support for the prebuilt XCFramework used by SPM and Carthage (#3767)

## 8.22.1

Expand Down
12 changes: 11 additions & 1 deletion scripts/build-xcframework.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

sdks=(iphoneos iphonesimulator macosx appletvos appletvsimulator watchos watchsimulator xros xrsimulator)
sdks=( iphoneos iphonesimulator macosx appletvos appletvsimulator watchos watchsimulator xros xrsimulator )

rm -rf Carthage/
mkdir Carthage
Expand All @@ -14,6 +14,8 @@ generate_xcframework() {

local createxcframework="xcodebuild -create-xcframework "

rm -rf Carthage/DerivedData

for sdk in "${sdks[@]}"; do
if [[ -n "$(grep "${sdk}" <<< "$ALL_SDKS")" ]]; then
xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration Release -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE
Expand All @@ -29,6 +31,14 @@ generate_xcframework() {
fi
done

#Create framework for mac catalyst
xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration Release -sdk macosx -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES

createxcframework+="-framework Carthage/DerivedData/Build/Products/Release-maccatalyst/${scheme}.framework "
if [ -d "Carthage/DerivedData/Build/Products/Release-maccatalyst/${scheme}.framework.dSYM" ]; then
createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/Release-maccatalyst/${scheme}.framework.dSYM "
fi

createxcframework+="-output Carthage/${scheme}${sufix}.xcframework"
$createxcframework
}
Expand Down

0 comments on commit 8aba9c4

Please sign in to comment.