Files
CMake/Help/generator/FASTBuild.rst
Eduard Voronkin f77628e0af FASTBuild: don't set default cache path
Leave only 2 option to set cache path:
1. CMake variable
2. Environment variable
Update docs to reflect the changes.
2025-09-11 11:25:36 -07:00

94 lines
2.7 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FASTBuild
=========
Generates a ``fbuild.bff`` file, which can be used to build the project with
`FASTBuild <https://www.fastbuild.org/docs/home.html>`_.
Usage
-----
Specify the generator when invoking :manual:`cmake(1)`:
.. code-block:: shell
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.
Caching
-------
To enable FASTBuild caching, set the cache path using the
:variable:`CMAKE_FASTBUILD_CACHE_PATH` variable or the
``FASTBUILD_CACHE_PATH`` environment variable.
Then build with the ``-cache`` flag:
.. code-block:: console
cmake --build <path-to-build> -- -cache
Configuration Variables
-----------------------
The following variables can be used to configure this generator:
* :variable:`CMAKE_FASTBUILD_CACHE_PATH`
* :variable:`CMAKE_FASTBUILD_CAPTURE_SYSTEM_ENV`
* :variable:`CMAKE_FASTBUILD_COMPILER_EXTRA_FILES`
* :variable:`CMAKE_FASTBUILD_ENV_OVERRIDES`
* :variable:`CMAKE_FASTBUILD_TRACK_BYPRODUCTS_AS_OUTPUT`
* :variable:`CMAKE_FASTBUILD_USE_LIGHTCACHE`
* :variable:`CMAKE_FASTBUILD_VERBOSE_GENERATOR`
Target Properties
-----------------
The following target properties can be used to fine-tune behavior on a
per-target basis:
* :prop_tgt:`FASTBUILD_CACHING`
disables caching for a specific target.
* :prop_tgt:`FASTBUILD_DISTRIBUTION`
disables distributed compilation for a specific target.
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
-------
.. code-block:: shell
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
--------
* :manual:`cmake-generators(7)`
* `FASTBuild Documentation <https://www.fastbuild.org/docs/documentation.html>`_