Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kubkon/zig-ios-example
Minimal build.zig for targeting iOS
https://github.com/kubkon/zig-ios-example
Last synced: 13 days ago
JSON representation
Minimal build.zig for targeting iOS
- Host: GitHub
- URL: https://github.com/kubkon/zig-ios-example
- Owner: kubkon
- License: unlicense
- Created: 2021-08-06T10:37:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T19:51:54.000Z (about 1 year ago)
- Last Synced: 2024-10-15T02:43:26.139Z (25 days ago)
- Language: Zig
- Size: 17.6 KB
- Stars: 128
- Watchers: 9
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - zig-ios-example🗒️Minimal build.zig for targeting iOS
README
# zig-ios-example
Minimal `build.zig` for targeting iOS with Zig toolchain.
# Building
For iOS Simulator on Apple Silicon Mac:
```
zig build -Dtarget=aarch64-ios-simulator
```For iOS Simulator on Intel Mac:
```
zig build -Dtarget=x86_64-ios-simulator
````If you are building natively on macOS and have Apple SDKs installed for Apple platforms, the path
to the SDK will be autodetected for you as part of the build script. You can still manually set the
path to the SDK via `--sysroot` flag.If you are cross-compiling from a different host such as Linux, or you don't have Apple SDKs installed
on macOS, you will need to provide the appropriate Apple SDK such as `iphoneos` if targeting hardware
devices or `iphonesimulator` if targeting the simulator. In this case, you will need to provide the path to
the SDK explicitly using the `--sysroot` flag.Setting the sysroot looks like this
```
zig build --sysroot -Dtarget=aarch64-ios-simulator
```## Running in iPhone Simulator
Fire up the simulator, and then install the app with
```
xcrun simctl install booted zig-out/bin/MadeWithZig.app
```You can run the app with
```
xcrun simctl launch booted madewithzig
```
## WIP: running on an iPhoneThis is more of a roadmap what I'd like the process to look like. For now, this only works for me
locally as I am in possession of Jakub's secret sauce! However, I am working hard on making both
[`zignature`](https://github.com/kubkon/zignature) and [`zig-deploy`](https://github.com/kubkon/zig-deploy)
more complete and actually functional for others, so stay tuned for updates!```
zig build -Dtarget=aarch64-ios.15.4...15.4
zignature -s --entitlement zig-out/bin/MadeWithZig.app
zig-deploy -n zig-out/bin/MadeWithZig.app
```