-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm64 simulators & catalyst support #475
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,10 @@ function build_host_hermesc { | |
# Utility function to configure an Apple framework | ||
function configure_apple_framework { | ||
local build_cli_tools enable_bitcode | ||
if [[ $1 == iphoneos ]]; then | ||
local catalyst="false" | ||
local platform=$1 | ||
|
||
if [[ $1 == iphoneos || $1 == catalyst ]]; then | ||
enable_bitcode="true" | ||
else | ||
enable_bitcode="false" | ||
|
@@ -56,11 +59,16 @@ function configure_apple_framework { | |
else | ||
build_cli_tools="false" | ||
fi | ||
if [[ $1 == catalyst ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
This comment was marked as resolved.
Sorry, something went wrong. |
||
catalyst="true" | ||
platform="macosx" | ||
fi | ||
|
||
local cmake_flags=" \ | ||
-DHERMES_APPLE_TARGET_PLATFORM:STRING=$1 \ | ||
-DHERMES_APPLE_TARGET_PLATFORM:STRING=$platform \ | ||
-DCMAKE_OSX_ARCHITECTURES:STRING=$2 \ | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=$3 \ | ||
-DHERMES_APPLE_CATALYST:BOOLEAN=$catalyst \ | ||
-DHERMES_ENABLE_DEBUGGER:BOOLEAN=true \ | ||
-DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \ | ||
-DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \ | ||
|
@@ -92,28 +100,18 @@ function build_apple_framework { | |
fi | ||
} | ||
|
||
# Accepts an array of frameworks and will place all of | ||
# the architectures into the first one in the list | ||
# Merges compiled frameworks and combines all of | ||
# the architectures into the single xcframework | ||
function create_universal_framework { | ||
cd ./destroot/Library/Frameworks || exit 1 | ||
|
||
local platforms=("$@") | ||
|
||
echo "Creating universal framework for platforms: ${platforms[*]}" | ||
|
||
for i in "${!platforms[@]}"; do | ||
platforms[$i]="${platforms[$i]}/hermes.framework/hermes" | ||
done | ||
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong. |
||
|
||
lipo -create -output "${platforms[0]}" "${platforms[@]}" | ||
echo "Creating universal framework for Apple Platforms" | ||
|
||
# Once all was linked into a single framework, clean destroot | ||
# from unused frameworks | ||
for platform in "${@:2}"; do | ||
rm -r "$platform" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason why this has been removed? This should be reverted. We need to clean up This is because CircleCI will package the entire There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I've reverted that removal |
||
done | ||
xcodebuild -create-xcframework -framework iphoneos/hermes.framework -framework iphonesimulator/hermes.framework -framework macosx/hermes.framework -output iphoneos/hermes.xcframework | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output should not assume the framework is just for iOS here, it should theoretically also be able to contain the macOS slices, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Also, it should also get the platforms from the |
||
|
||
lipo -info "${platforms[0]}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason why this has been removed? I think this is a good add-on for debugging purposes on the CI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because lipo -info fails on xcframework with a fatal error: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
rm -r iphonesimulator | ||
rm -r macosx | ||
rm -r iphoneos/hermes.framework | ||
|
||
cd - || exit 1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also replace further use of
$1
with the$platform
alias here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually not use
$platform
here. Further explanation on line 62.