iOSBuild Documentation

This page contains the documentation for the iOSBuild project.

iOSBuild

macOS Python GitHub uv Pytest GitHub Actions CI Build Read the Docs Documentation Status CodeCov Coverage License: MIT Buy Me A Coffee No AI

Welcome to iOSBuild, a Python application for building CMake libraries for Apple systems. The aim of the project is to use a CMakeLists.txt file to generate an XCFramework containing static libraries for use across iOS and other Apple operating systems.

This project makes use of the ios-cmake toolchain to configure and build the libraries using CMake. The libraries are built for each of the specified platforms and combined into a single xcframework for each library. These may then be included in iOS, watchOS, visionOS, tvOS, and macOS applications using Xcode.

Pre-requisites

In order to run the code there are a number of non-Python projects which must be installed:

  • CMake (minimum tested version 3.22)

  • XCode (command line tools)

  • Apple SDKs for each of the specified targets

  • Python (versions 3.9-3.13 supported)

Optional Dependencies:

Since the project requires XCode and the SDK for each target platform, the project only works for macOS.

Getting started

This repository includes a simple example CMake project for testing the build system.

To build using pip from this repo:

pip install iosbuild
pip -m ios_build -v example

This builds the example project using sensible defaults for iOS (ARM64), iOS Simulator (ARM64), and macOS (ARM64). This configuration builds the files in a subdirectory build of the current directory, downloads the ios.toolchain.cmake file to the current directory and installs the libraries and the xcframework to install. If successful, this outputs a file libiosbuildexample.xcframeworks in the install/ directory.

See also

doc:

contents

Indices and tables