Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/LiveSplit/livesplit-core/llms.txt

Use this file to discover all available pages before exploring further.

This page covers everything you need to compile livesplit-core yourself: adding it to a Rust project, building the C API library, generating language bindings, understanding Cargo features, and finding pre-built releases.

Prerequisites

  • Rust — install the latest stable toolchain via rustup.rs.
  • Cargo — included with every Rust installation.
Verify your installation:
rustc --version
cargo --version
No other system dependencies are required for a basic build. Some optional features (e.g. font-loading on Windows) pull in platform-specific system libraries automatically through their crate dependencies.

Using livesplit-core as a Rust Dependency

If you are writing a Rust application, you do not need to clone the repository. Simply add the crate to your Cargo.toml:
Cargo.toml
[dependencies]
livesplit-core = "0.13.0"
Then cargo build will fetch and compile everything. To enable optional features, list them explicitly:
Cargo.toml
[dependencies]
livesplit-core = { version = "0.13.0", features = ["software-rendering", "auto-splitting"] }

Building the C API

The livesplit-core-capi workspace member exposes the full library surface through a C-compatible ABI. Build it when you need a shared (.so / .dll / .dylib) or static (.a / .lib) library to link against from C, C++, C#, Swift, or any other language.
1

Clone the repository

git clone https://github.com/LiveSplit/livesplit-core.git
cd livesplit-core
2

Build both shared and static libraries

This single command produces both a shared library and a static library in one pass:
cargo build --release -p livesplit-core-capi
3

Build only the shared library

If you only need a dynamically linked library (.so, .dll, or .dylib), use:
cargo rustc --release -p livesplit-core-capi --crate-type cdylib
4

Build only the static library

If you only need a statically linked archive (.a or .lib), use:
cargo rustc --release -p livesplit-core-capi --crate-type staticlib
5

Locate the output

After any of the commands above, the compiled library is placed in:
target/release/
The exact filename depends on your host operating system:
PlatformShared libraryStatic library
Linuxliblivesplit_core.soliblivesplit_core.a
macOSliblivesplit_core.dylibliblivesplit_core.a
Windowslivesplit_core.dlllivesplit_core.lib

Generating Language Bindings

livesplit-core ships a code-generation tool in capi/bind_gen that reads the C API and emits idiomatic bindings for every supported target language.
cd capi/bind_gen
cargo run
The generated files are written to capi/bindings/ and cover the following languages out of the box:
LanguageNotes
CPlain C header (livesplit_core.h)
C#P/Invoke wrapper classes
Java (JNA)Java Native Access interface
Java (JNI)Java Native Interface variant
KotlinKotlin JNI variant
SwiftSwift module map and wrappers
RubyRuby FFI bindings
PythonPython ctypes bindings
TypeScript (Node.js)TypeScript declarations for the native addon
WebAssemblyTypeScript declarations for the WASM package
Regenerate bindings any time you update the C API source, then commit the generated files alongside the rest of your project.

Cargo Features

livesplit-core uses Cargo feature flags to keep the binary size small on resource-constrained targets and to avoid pulling in heavy optional dependencies. The table below lists the most important flags:
FeatureDefaultDescription
stdEnables Rust standard library support. Disable for no_std targets such as bare-metal ARM or RISC-V.
image-shrinkingAutomatically resizes large images embedded in runs to reduce memory usage. Implies std and more-image-formats.
localizationEnables localisation of built-in component labels.
auto-splittingEnables the WebAssembly auto splitter runtime (livesplit-auto-splitting). Requires std.
software-renderingEnables the CPU-based renderer powered by tiny-skia. Useful for headless or embedded environments.
svg-renderingEnables the SVG layout renderer.
font-loadingEnables system font discovery and loading. Requires std and default-text-engine.
web-renderingEnables the WebAssembly Canvas-based renderer for browser environments. Implies wasm-web.
wasm-webEnables wasm-bindgen integration for wasm32-unknown-unknown targets.
therun-ggEnables live race data integration with therun.gg via HTTP (uses reqwest + rustls).
To enable a feature, add it to your dependency declaration:
Cargo.toml
[dependencies]
livesplit-core = { version = "0.13.0", features = ["software-rendering", "auto-splitting"] }
To build with no default features (useful for no_std targets), disable them explicitly:
Cargo.toml
[dependencies]
livesplit-core = { version = "0.13.0", default-features = false }

Pre-built Releases

Pre-compiled binaries for the most common target platforms are available on the GitHub Releases page: https://github.com/LiveSplit/livesplit-core/releases Each release includes shared and static libraries for Windows (x86, x86_64, ARM64), macOS (x86_64, Apple Silicon), Linux (x86_64 and common variants), Android, iOS, and WebAssembly, along with the generated language bindings for all supported languages.
Pre-built releases cover the most common targets. If you need a custom target (e.g. a specific musl variant, bare-metal architecture, or a non-default feature set), build from source using the instructions above.

Build docs developers (and LLMs) love