Fix iOS build script

This commit is contained in:
wheremyfoodat 2025-03-16 21:16:52 +02:00
parent 19473cb82c
commit 3e11bd0bf2
3 changed files with 46 additions and 8 deletions

34
.github/workflows/iOS_Build.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: iOS Simulator Build
on:
push:
branches:
- master
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Setup Vulkan SDK
uses: humbletim/setup-vulkan-sdk@main
with:
vulkan-query-version: 1.3.296.0
vulkan-use-cache: true
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang
- name: Build core and frontend
run: cd src/pandios && ./build.sh

View file

@ -1,15 +1,20 @@
#!/bin/bash
# Settings for the SwiftUI frontend
ARCH=arm64
CONFIGURATION=Release
SDK=iphonesimulator18.2
runSimulator=false
# Settings for the emulator core
EMULATOR_BUILD_TYPE=Release
# Simulator settings
RUN_SIMULATOR=false
# Go to the parent directory and build the emulator core
cd ../..
cmake -B build -DENABLE_VULKAN=OFF -DBUILD_HYDRA_CORE=ON -DCMAKE_TOOLCHAIN_FILE=third_party/ios_toolchain/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DDEPLOYMENT_TARGET="13.0"
cmake --build build
cmake -B build -DENABLE_VULKAN=OFF -DBUILD_HYDRA_CORE=ON -DENABLE_USER_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=third_party/ios_toolchain/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DDEPLOYMENT_TARGET="13.0"
cmake --build build --config ${EMULATOR_BUILD_TYPE}
# Copy the bridging header from the emulator source to the Swift interop module folder
cp ./include/ios_driver.h ./src/pandios/Alber/Headers/ios_driver.h
@ -19,11 +24,10 @@ cd src/pandios
xcodebuild build -configuration ${CONFIGURATION} -sdk ${SDK} -arch ${ARCH}
# To run the app in the simulator:
# Boot the iPhone, install the app on the iphone, then open the sim & launch the app
if [ "$runSimulator" = true ] ; then
xcrun simctl boot "iPhone 16"
xcrun simctl install "iPhone 16" "build/Release-iphonesimulator/Pandios.app"
if [ "$RUN_SIMULATOR" = true ] ; then
xcrun simctl boot "iPhone 16 Pro"
xcrun simctl install "iPhone 16 Pro" "build/Release-iphonesimulator/Pandios.app"
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
xcrun simctl launch booted "Alber.Pandios"
xcrun simctl launch --console booted "Alber.Pandios"
fi