Skip to content

Commit

Permalink
Adding yamato script to crossbuild apple silicon support.
Browse files Browse the repository at this point in the history
Trying my shiny new mac image with latest OS and xcode
  • Loading branch information
UnityAlex authored and joncham committed Feb 28, 2022
1 parent 391d455 commit 8675a5c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .yamato/build_osx_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% metadata_file .yamato/Globals.metafile %}
---
name: Build OSX ARM64

agent:
type: Unity::VM::osx
image: platform-foundation/mac-10.15-bokken:latest
flavor: m1.mac

variables:
ARTIFACT_FILENAME: {{globals.artifact_base_name}}-osx-arm64.7z

commands:
- mkdir artifacts
- curl https://public-stevedore.unity3d.com/r/public/7za-mac-x64/e6c75fb7ffda_5bd76652986a0e3756d1cfd7e84ce056a9e1dbfc5f70f0514a001f724c0fbad2.zip --output artifacts/7za-mac-x64.zip
- unzip artifacts/7za-mac-x64.zip -d artifacts/7za-mac-x64
- |
cd unity/unitygc
mkdir release
cd release
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
- LD_LIBRARY_PATH=/usr/local/opt/openssl/lib ./build.sh -subset clr+libs -a arm64 -c release -cross -ci -ninja /p:CrossBuild=true
- cp unity/unitygc/release/libunitygc.dylib artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Release/runtimes/osx-arm64/native
- artifacts/7za-mac-x64/7za a artifacts/unity/$ARTIFACT_FILENAME ./artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Release/runtimes/osx-arm64

artifacts:
osx-arm64-7z:
paths:
- artifacts/unity/**
osx-arm64:
paths:
- artifacts/bin/**
31 changes: 31 additions & 0 deletions .yamato/test_osx_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% metadata_file .yamato/Globals.metafile %}
---
name: Test OSX ARM64

agent:
type: Unity::VM::osx
image: platform-foundation/mac-bokken:v0.1.8-972754
flavor: m1.mac

dependencies:
- path: .yamato/build_osx_arm64.yml

commands:
# build/run tests
- dotnet build unity/managed.sln -c Release
- |
cd unity/embed_api_tests
cmake -DCMAKE_BUILD_TYPE=Release .
cmake --build .
./mono_test_app
- LD_LIBRARY_PATH=/usr/local/opt/openssl/lib ./build.sh -subset libs.tests -test -a arm64 -c release -ci -ninja
- ./src/tests/build.sh arm64 release ci
- ./src/tests/run.sh arm64 release
- ./build.sh clr.paltests
- ./artifacts/bin/coreclr/OSX.arm64.Debug/paltests/runpaltests.sh $(pwd)/artifacts/bin/coreclr/OSX.arm64.Debug/paltests

triggers:
pull_requests:
- targets:
only:
- "unity-main"

0 comments on commit 8675a5c

Please sign in to comment.