cmake_build
cmake_build runs the native build tool through the managed CMake installation. The build runs during xx run; pass its returned dependency to tasks that need the built artifacts.
Arguments
| Argument | Required | Description |
|---|---|---|
generation | Yes | Matching dependency returned by cmake_generate; selects the build directory and orders generation before building. |
targets | No | Build targets passed with --target. An empty list builds the default target. Defaults to []. |
config | No | Configuration passed with --config for multi-configuration generators, such as "Release". |
parallel | No | Positive number of parallel build jobs passed with --parallel. |
clean_first | No | Clean before building the selected targets. Defaults to False. |
verbose | No | Print the underlying build commands. Defaults to False. |
deps | No | Dependencies activated before building, in list order. Defaults to []. |
The managed CMake installation is automatic; do not add cmake or generation to deps. The build directory must remain inside the project and contain a generated CMakeCache.txt after dependencies finish.
Builds using the same generation are automatically serialized in declaration order so they cannot mutate the build tree concurrently.
Example
load("@[email protected]", "cmake_build", "cmake_generate")
load("@[email protected]", "ninja")
configure = cmake_generate(
generator="Ninja",
build_type="Release",
deps=[ninja],
)
build = cmake_build(
configure,
targets=["app"],
parallel=8,
)