Skip to content

Commit

Permalink
feat: Apple tvOS and Apple visionOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
atteneder committed Oct 24, 2023
1 parent a1556d6 commit ae55a20
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,28 @@ jobs:
EXECUTABLE_SUFFIX=-simulator.a
ONLY_ACTIVE_ARCH=NO
- name: configure tvOS
run: >
cmake . -G Xcode -B build_tvos
-DCMAKE_BUILD_TYPE=MinSizeRel
-DCMAKE_SYSTEM_NAME=tvOS
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.0
-DDRACO_UNITY_PLUGIN=ON
-DDRACO_GLTF_BITSTREAM=ON
-DDRACO_BACKWARDS_COMPATIBILITY=OFF
- name: build tvOS
run: cmake --build build_tvos --config MinSizeRel --target draco_unity
- name: build tvOS Simulator
run: >
cmake
--build build_tvos
--config MinSizeRel
--target draco_unity
--
-sdk appletvsimulator
EXECUTABLE_SUFFIX=-simulator.a
ONLY_ACTIVE_ARCH=NO
- name: package Apple
run: |
mkdir draco_apple
Expand All @@ -88,6 +110,9 @@ jobs:
mkdir -p draco_apple/iOS
mv build_ios/MinSizeRel-iphoneos/libdraco_unity.a draco_apple/iOS
mv build_ios/MinSizeRel-iphonesimulator/libdraco_unity-simulator.a draco_apple/iOS
mkdir -p draco_apple/tvOS
mv build_tvos/MinSizeRel-appletvos/libdraco_unity.a draco_apple/tvOS
mv build_tvos/MinSizeRel-appletvsimulator/libdraco_unity-simulator.a draco_apple/tvOS
- name: upload artifact
uses: actions/upload-artifact@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ else()
endif()

if(DRACO_UNITY_PLUGIN)
if(IOS OR EMSCRIPTEN)
if(IOS OR EMSCRIPTEN OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS")
set(unity_decoder_lib_type STATIC)
else()
set(unity_decoder_lib_type MODULE)
Expand Down Expand Up @@ -1110,8 +1110,8 @@ else()
OBJLIB_DEPS ${unity_objlib_dependency} draco_unity_enc_plugin
)

# For Mac, we need to build a .bundle for the unity plugin.
if(APPLE)
# For macOS, we need to build a .bundle for the unity plugin.
if(APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_target_properties(draco_unity PROPERTIES BUNDLE true)
endif()
endif()
Expand Down

0 comments on commit ae55a20

Please sign in to comment.