This repository contains:
-
A modified Lean 4 source tree so that the Lean runtime and stage0 standard library can be compiled with the iOS toolchain and linked into native iOS apps.
-
common Makefiles and C framework for building iOS SDL3 apps.
-
Some examples demonstrating how to use the framework.
-
Clone the repo including submodules (
lean4, SDL, SDL_ttf, and resvg live as submodules underlean4/andthird-party/):git clone --recursive https://github.com/paulcadman/lean-ios.gitOr, if you already cloned without
--recursive:git submodule update --init --recursive -
Install Xcode.
-
Install the Xcode command line tools:
xcode-select --install -
Install Homebrew, then install the build dependencies:
brew install cmake zstd -
Install Rust (the SDL-based examples link against
resvg, which is built from source):curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThen add the iOS targets:
rustup target add aarch64-apple-ios-sim aarch64-apple-ios
Each example has a Makefile.device target that codesigns and installs the app
on a connected iOS device. Invoke it with make -f Makefile.device run-device-app and set the following environment variables:
DEVICE_ID— the device UDID or name (as shown byxcrun devicectl list devices).DEVICE_CODESIGN_IDENTITY— the codesigning identity to use (e.g.Apple Development: Your Name (TEAMID), as shown bysecurity find-identity -v -p codesigning).DEVICE_PROVISION_PROFILE— path to a.mobileprovisionfile whose bundle identifier matches the example'sAPP_BUNDLE_ID(orSDL_APP_BUNDLE_ID).
See docs/architecture.md for an overview of the project structure and build dependencies.


