Add iOS build script

This commit is contained in:
wheremyfoodat 2025-03-16 20:42:42 +02:00
parent d31925d754
commit cdb281c753
4 changed files with 37 additions and 1 deletions

View file

@ -1 +1,2 @@
libAlber.dylib
libAlber.dylib
Alber/Headers/ios_driver.h

View file

@ -409,9 +409,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Pandios/Preview Content\"";
DEVELOPMENT_TEAM = 877A43U8RR;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@ -430,6 +432,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = Alber.Pandios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_INCLUDE_PATHS = "$(PROJECT_DIR)/Alber";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -444,9 +447,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Pandios/Preview Content\"";
DEVELOPMENT_TEAM = 877A43U8RR;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@ -465,6 +470,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = Alber.Pandios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_INCLUDE_PATHS = "$(PROJECT_DIR)/Alber";
SWIFT_VERSION = 5.0;

29
src/pandios/build.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
ARCH=arm64
CONFIGURATION=Release
SDK=iphonesimulator18.2
runSimulator=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
# 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
# Come back to the iOS directory, build the SwiftUI xcode project and link them together
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"
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
xcrun simctl launch booted "Alber.Pandios"
fi