Skip to content

otok.toml

otok.toml lies in the root of your project. It is data: otok never runs anything from it. Everything that changes what is built is in this file; machine settings never are. The complete, normative description is the specification; this page lists the keys.

[otok]
format = 1
[apple]
platforms = ["ios", "iossim", "macosx"]
deployment = { ios = "16.0", macos = "13.0" }
[deps.openssl]
recipe = "apotocki/openssl"
version = "~> 4.1"
options = { no-deprecated = true }
[profile.ci]
apple = { platforms = ["iossim"] }
[policy]
deny-licenses = ["GPL-3.0-only", "AGPL-3.0-only"]

An unknown key, a wrong type or a misspelled name is an error, reported with its line before anything is resolved.

Key Meaning
format Required, 1.
include Files with more [deps] and [tool-deps] tables, for lists generated by other tools.
tool-build-on The environment in which the tools that build libraries are built on each system (default macos/xcode, linux/gcc, windows/msvc).
tools-output Where the tools with deliver go (default Otok/tools), inside the project; it may be inside a target’s output.

[apple], [android], [windows], [linux]: a project needs at least one. See Several targets.

Key Meaning
platforms [apple] only: ios, iossim, macosx, catalyst, tvos, tvossim, watchos, watchossim, xros, xrossim. The other targets have one platform each.
architectures Fewer architectures than all, per platform: { iossim = ["arm64"] }, { android = ["arm64-v8a"] }, { windows = ["x86_64"] }.
deployment Minimum OS versions: ios, catalyst, macos, tvos, watchos, visionos for [apple]; android (the API level) for [android]. Required for every platform built.
build-on The build environments: required for [windows] (windows/msvc, windows/clang-cl, linux/clang-cl) and [linux] (linux/gcc, linux/clang).
output The output directory, Otok by default.
configurations ["release"] by default; ["debug", "release"] for Windows programs with debug builds. One for [apple].
linkage "static" (default) or "dynamic".
cflags, cxxflags, ldflags Flags for every library of the target.
c-standard, cxx-standard The C and C++ standard of every library of the target (17, 20, 23, …).
stl [android]: "shared" (default) or "static", the C++ runtime of dynamic libraries.
bundle-id-prefix [apple]: the start of the bundle identifiers of dynamic frameworks, org.otok by default.

A library your project uses. The table’s name is the library’s name.

Key Meaning
recipe "publisher/name" from the index; { git = "<url>", rev = "<full commit>", path = "<dir>" }; or { path = "<dir>" }.
version A constraint: "~> 1.10" (>= 1.10, < 2), ">= 3.0, < 3.6", "1.3.2" (exactly). Required for a recipe of the index.
prerelease true to allow pre-release versions.
options The recipe’s options (otok info <recipe> lists them).
platforms Build this library for fewer platforms.
linkage "static" or "dynamic", for this library.
cflags, cxxflags, ldflags Flags for this library.
source { path = "<dir>" }: build from a local source instead of the recipe’s.
bundle-data true: the library’s data files are also resources of its products (Apple).
deliver ["protoc"], or true for all: the programs of the library’s recipe, at the library’s version, built for this machine into Otok/tools/. See Tools for your own build.

Chooses the recipe, version and options of a tool the recipes build with (CMake, Ninja, Python, …): recipe, version, prerelease, options, source, flags and standards, as in [deps]. A tool no recipe uses is a warning, unless the project delivers it.

deliver gives a tool to your own build (a code generator, a compiler of your scripts): otok builds it for the machine though no recipe uses it, locks it, and copies it into Otok/tools/<library>/ after the libraries, with otok-tools.cmake (Otok_TOOL_<program>), otok-tools.props ($(OtokTool_<program>)) and otok-tools.toml naming its programs: true for all the programs of the recipe, or a list of them. A tool of a library in [deps], such as protoc, is delivered from there instead, so that both have one version; a [tool-deps] entry of the same recipe beside it then only chooses the tool’s options and flags. See Tools for your own build.

[tool-deps.annium-compile]
recipe = { git = "https://example.com/recipes.git", rev = "<commit>", path = "annium-compile" }
deliver = true

cxx-standard and c-standard here apply to that tool. Without them a tool and the libraries it links get the lowest standard their recipes allow, as the libraries of a target do.

Changes chosen with --profile <name>: the target tables’ platforms, architectures, deployment, flags, configurations, linkage and standards; deps.<library> options, platforms, flags and linkage; tool-deps.<library> options and flags. See Profiles.

deny-licenses or allow-licenses: SPDX license identifiers. Resolution fails when a library, tools included, is licensed only under a denied license, or under none of the allowed ones. otok audit checks the lock the same way.

asset-mirror, url-rewrite, mirrors-only: locations of the project’s inputs, as in config.toml. See Where inputs come from.

More indexes than the public one, such as your organization’s:

[indexes.corp]
url = "view+https://otok.corp.example/index"
publishers = ["corp"]
[index-of]
"apotocki/zlib" = "corp"

publishers are looked up only in that index; [index-of] chooses the index of a recipe found in several.

© 2026 Alexander A Pototskiy and contributors. Text CC BY 4.0; examplesCC0.