Reference
project.toml
Every key of a package's manifest, from spec chapter 11.
A package is a folder with a project.toml. A key it doesn’t use is a warning, and its other
mistakes are errors at their lines. Paths in it take \ as /, so one written on Windows means
the same everywhere.
[project]
name = "game"
version = "0.1.0"
main = "main.fb" # the default
type = "executable" # or "library"
[dependencies]
physics = { path = "../physics" }
engine = { path = "../engine", link = "beside" }
[native]
joltc = { static = "libs/joltc" }
m = { system = "m" }
render = { dynamic = "native/{target}/render" }
[format]
width = 100[project]
| Key | |
|---|---|
name | Required. An identifier other than std: what Import names the package by, and the start of its modules’ names |
version | Required. Three numbers, like "0.1.0" |
main | The main file, a .fb file in the package’s folder: main.fb unless it says otherwise, which has to be there if it’s written |
type | "executable", the default for a package with a main file, builds a program; "library", the default for one without, is built into the programs that use it, or beside them. An executable without a main file, or a library with main written, is an error |
[dependencies]
Until the package manager, a dependency is a local package, by its folder from this
project.toml. A version string, like physics = "1.2", waits for the registry.
| Key | |
|---|---|
path | The dependency’s folder |
link | For a library: "embed", the default, links its code into the executable; "beside" builds it as the OS’s own dynamic library beside the executable, <name>.dll, lib<name>.so, or lib<name>.dylib. Only the program decides: link in a library’s own [dependencies] is ignored, with a warning |
Two packages of one name, and packages that depend on each other in a cycle, are errors.
[native]
A package’s C libraries, each by the name its Extern blocks’ Lib gives it. A name is letters,
digits, and _, -, ., or +, not starting with -.
| Form | |
|---|---|
joltc = "libs/joltc" or { static = "libs/joltc" } | A static archive from the package’s folder: the file itself, or without its lib prefix and extension, as libs/libjoltc.a, libs/joltc.a, or libs/joltc.lib, which is linked into the executable |
m = { system = "m" } | A library the system’s linker finds by its name, as -lm |
engine = { dynamic = "native/{target}/engine" } | A dynamic library the program loads as it starts, which the build copies beside the executable |
{target} in a path is the target the program is built for: windows-x64, linux-x64,
linux-arm64, macos-arm64, or macos-x64. A program links every static [native] library of
its packages, its own first, then each package’s in its project.toml’s order.
[format]
| Key | |
|---|---|
width | The line width fb fmt formats the package’s code to: 40 to 1000, 100 without it |
Report an issue with this page or with FutureBlitz on GitHub.