FASTBuild

Added in version 4.2.

Generates a fbuild.bff file, which can be used to build the project with FASTBuild.

Usage

Specify the generator when invoking cmake(1):

cmake [<options>] -G FASTBuild -B <path-to-build> [-S <path-to-source>]

This writes a FASTBuild configuration file named fbuild.bff into <path-to-build>.

Note

This generator also produces IDE project files for Visual Studio and Xcode, which are placed under:

  • <path-to-build>/VisualStudio - Visual Studio solution and projects

  • <path-to-build>/XCode - Xcode workspace and projects

These IDE files can be generated by building xcode or solution targets and will build using FASTBuild as the backend.

Built-in Targets

Added in version 4.5: When the CMAKE_TEST_BUILD_DEPENDS variable is enabled, the generated build file provides the following targets:

test_prep/<test-name>

Builds all known build dependencies for the test named <test-name> added by add_test(), including the executable target invoked by the test, targets referenced by generator expressions in the test command, and explicit BUILD_DEPENDS entries.

Tests whose names are not valid target names are excluded. If multiple tests in different directories share the same name, their dependencies are merged into one test_prep/<test-name> target.

Individual test_prep/<test-name> targets are not created for tests discovered at test time, because their names are not known during generation.

test_prep/all

Depends on every generated test_prep/<test-name> target. Also builds dependencies recorded by the CMAKE_TEST_BUILD_DEPENDS directory property.

Caching

To enable FASTBuild caching, set the cache path using the CMAKE_FASTBUILD_CACHE_PATH variable or the FASTBUILD_CACHE_PATH environment variable.

Then build with the -cache flag:

cmake --build <path-to-build> -- -cache

Compiler Behavior Variables

The following variables control how compiler nodes are emitted in the generated fbuild.bff. These settings may affect build determinism, debug info paths, include handling, and compiler argument formatting:

Configuration Variables

The following variables can be used to configure this generator:

Target Properties

The following target properties can be used to fine-tune behavior on a per-target basis:

Notes

  • This generator does not support directories as outputs of custom commands. If you do specify a directory as an output, it should be marked with the SYMBOLIC property to avoid incorrect behavior.

  • It is highly advised to use custom commands with only one output. If multiple outputs are specified, the generator will emit an additional rule to check the outputs at build time. This adds overhead and is necessary because FASTBuild natively supports only a single output per custom step.

Example

cmake [<options>] -G FASTBuild -B <path-to-build> -DCMAKE_BUILD_TYPE=Release
cmake --build <path-to-build> --target my_app

This generates fbuild.bff in <path-to-build> and uses FASTBuild to build the my_app target.

See Also