10
10
set -e
11
11
12
12
# Given a specific target, retrieve the right architecture for it
13
- # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst
13
+ # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
14
14
function get_architecture {
15
- if [[ $1 == " iphoneos" ]]; then
15
+ if [[ $1 == " iphoneos" || $1 == " xros " || $1 == " xrsimulator " ]]; then
16
16
echo " arm64"
17
17
elif [[ $1 == " iphonesimulator" ]]; then
18
18
echo " x86_64;arm64"
@@ -24,15 +24,23 @@ function get_architecture {
24
24
fi
25
25
}
26
26
27
+ function get_deployment_target {
28
+ if [[ $1 == " xros" || $1 == " xrsimulator" ]]; then
29
+ echo " $( get_visionos_deployment_target) "
30
+ else
31
+ echo " $( get_ios_deployment_target) "
32
+ fi
33
+ }
34
+
27
35
# build a single framework
28
36
# $1 is the target to build
29
37
function build_framework {
30
38
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
31
- ios_deployment_target =$( get_ios_deployment_target )
39
+ deployment_target =$( get_deployment_target " $1 " )
32
40
33
41
architecture=$( get_architecture " $1 " )
34
42
35
- build_apple_framework " $1 " " $architecture " " $ios_deployment_target "
43
+ build_apple_framework " $1 " " $architecture " " $deployment_target "
36
44
else
37
45
echo " Skipping; Clean \" destroot\" to rebuild" .
38
46
fi
@@ -41,7 +49,7 @@ function build_framework {
41
49
# group the frameworks together to create a universal framework
42
50
function build_universal_framework {
43
51
if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
44
- create_universal_framework " iphoneos" " iphonesimulator" " catalyst"
52
+ create_universal_framework " iphoneos" " iphonesimulator" " catalyst" " xros " " xrsimulator "
45
53
else
46
54
echo " Skipping; Clean \" destroot\" to rebuild" .
47
55
fi
@@ -56,6 +64,8 @@ function create_framework {
56
64
build_framework " iphoneos"
57
65
build_framework " iphonesimulator"
58
66
build_framework " catalyst"
67
+ build_framework " xros"
68
+ build_framework " xrsimulator"
59
69
60
70
build_universal_framework
61
71
else
0 commit comments