Skip to content
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

Initial support for visionOS #1083

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ enable_default_architecture_variants() {
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_MAC_CATALYST]=1
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_APPLETVOS]=1
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_APPLETVSIMULATOR]=1
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_XROS]=1
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_XRSIMULATOR]=1
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_MACOS]=1
}

Expand Down Expand Up @@ -98,6 +100,12 @@ disable_arch_variant() {
appletvsimulator)
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_APPLETVSIMULATOR]=0
;;
xros)
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_XROS]=0
;;
xrsimulator)
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_XRSIMULATOR]=0
;;
macosx)
ENABLED_ARCHITECTURE_VARIANTS[ARCH_VAR_MACOS]=0
;;
Expand Down Expand Up @@ -136,6 +144,7 @@ fi
# DETECT SDK VERSIONS
DETECTED_IOS_SDK_VERSION="$(xcrun --sdk iphoneos --show-sdk-version 2>>"${BASEDIR}"/build.log)"
DETECTED_TVOS_SDK_VERSION="$(xcrun --sdk appletvos --show-sdk-version 2>>"${BASEDIR}"/build.log)"
DETECTED_XROS_SDK_VERSION="$(xcrun --sdk xros --show-sdk-version 2>>"${BASEDIR}"/build.log)"
DETECTED_MACOS_SDK_VERSION="$(xcrun --sdk macosx --show-sdk-version 2>>"${BASEDIR}"/build.log)"
echo -e "INFO: Using iOS SDK: ${DETECTED_IOS_SDK_VERSION}, tvOS SDK: ${DETECTED_TVOS_SDK_VERSION}, macOS SDK: ${DETECTED_MACOS_SDK_VERSION} by Xcode provided at $(xcode-select -p)\n" 1>>"${BASEDIR}"/build.log 2>&1
echo -e "INFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1
Expand Down
57 changes: 57 additions & 0 deletions scripts/function-apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ disable_tvos_architecture_not_supported_on_detected_sdk_version() {
fi
}

#
# 1. architecture index
#
disable_xros_architecture_not_supported_on_detected_sdk_version() {
local ARCH_NAME=$(get_arch_name $1)

# No need to disable for any architecture at the moment, left as placeholder for the future
case ${ARCH_NAME} in
*)
local SUPPORTED=1
;;
esac

if [[ ${SUPPORTED} -ne 1 ]]; then
if [[ -z ${BUILD_FORCE} ]]; then
echo -e "INFO: Disabled ${ARCH_NAME} architecture which is not supported on visionOS SDK $DETECTED_XROS_SDK_VERSION\n" 1>>"${BASEDIR}"/build.log 2>&1
disable_arch "${ARCH_NAME}"
fi
fi
}

#
# 1. architecture index
#
Expand Down Expand Up @@ -160,6 +181,8 @@ build_apple_architecture_variant_strings() {
export ALL_TVOS_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_TVOS}")"
export APPLETVOS_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_APPLETVOS}")"
export APPLETV_SIMULATOR_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_APPLETVSIMULATOR}")"
export XROS_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_XROS}")"
export XR_SIMULATOR_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_XRSIMULATOR}")"
export MACOSX_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_MACOS}")"
}

Expand Down Expand Up @@ -647,6 +670,12 @@ get_framework_directory() {
"${ARCH_VAR_TVOS}")
echo "bundle-apple-framework-tvos${LTS_POSTFIX}"
;;
"${ARCH_VAR_XROS}")
echo "bundle-apple-framework-xros${LTS_POSTFIX}"
;;
"${ARCH_VAR_XRSIMULATOR}")
echo "bundle-apple-framework-xrsimulator${LTS_POSTFIX}"
;;
"${ARCH_VAR_APPLETVOS}")
echo "bundle-apple-framework-appletvos${LTS_POSTFIX}"
;;
Expand Down Expand Up @@ -709,6 +738,12 @@ get_universal_library_directory() {
"${ARCH_VAR_APPLETVSIMULATOR}")
echo "bundle-apple-universal-appletvsimulator${LTS_POSTFIX}"
;;
"${ARCH_VAR_XROS}")
echo "bundle-apple-universal-xros${LTS_POSTFIX}"
;;
"${ARCH_VAR_XRSIMULATOR}")
echo "bundle-apple-universal-xrsimulator${LTS_POSTFIX}"
;;
"${ARCH_VAR_MACOS}")
echo "bundle-apple-universal-macos${LTS_POSTFIX}"
;;
Expand Down Expand Up @@ -797,6 +832,16 @@ get_apple_architectures_for_variant() {
ARCHITECTURES+=" $(get_full_arch_name "${index}") "
done
;;
"${ARCH_VAR_XROS}")
for index in ${ARCH_ARM64} ${ARCH_ARM64_SIMULATOR}; do
ARCHITECTURES+=" $(get_full_arch_name "${index}") "
done
;;
"${ARCH_VAR_XRSIMULATOR}")
for index in ${ARCH_ARM64_SIMULATOR}; do
ARCHITECTURES+=" $(get_full_arch_name "${index}") "
done
;;
"${ARCH_VAR_MACOS}")
for index in ${ARCH_ARM64} ${ARCH_X86_64}; do
ARCHITECTURES+=" $(get_full_arch_name "${index}") "
Expand Down Expand Up @@ -977,6 +1022,9 @@ get_default_sdk_name() {
tvos)
echo "appletvos"
;;
xros)
echo "xros"
;;
macos)
echo "macosx"
;;
Expand All @@ -996,6 +1044,9 @@ get_sdk_name() {
tvos)
echo "appletvos"
;;
xros)
echo "xros"
;;
macos)
echo "macosx"
;;
Expand Down Expand Up @@ -1025,6 +1076,9 @@ get_sdk_name() {
tvos)
echo "appletvsimulator"
;;
xros)
echo "xrsimulator"
;;
esac
;;
*-mac-catalyst)
Expand Down Expand Up @@ -1096,6 +1150,9 @@ get_min_sdk_version() {
tvos)
echo "${TVOS_MIN_VERSION}"
;;
xros)
echo "${XROS_MIN_VERSION}"
;;
macos)
echo "${MACOS_MIN_VERSION}"
;;
Expand Down
Loading