FASTBuild.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. FASTBuild
  2. =========
  3. .. versionadded:: 4.2
  4. Generates a ``fbuild.bff`` file, which can be used to build the project with
  5. `FASTBuild <https://www.fastbuild.org/docs/home.html>`_.
  6. Usage
  7. -----
  8. Specify the generator when invoking :manual:`cmake(1)`:
  9. .. code-block:: shell
  10. cmake [<options>] -G FASTBuild -B <path-to-build> [-S <path-to-source>]
  11. This writes a FASTBuild configuration file named ``fbuild.bff`` into
  12. ``<path-to-build>``.
  13. .. note::
  14. This generator also produces IDE project files for Visual Studio and Xcode,
  15. which are placed under:
  16. * ``<path-to-build>/VisualStudio`` – Visual Studio solution and projects
  17. * ``<path-to-build>/XCode`` – Xcode workspace and projects
  18. These IDE files can be generated by building ``xcode`` or ``solution`` targets
  19. and will build using FASTBuild as the backend.
  20. Caching
  21. -------
  22. To enable FASTBuild caching, set the cache path using the
  23. :variable:`CMAKE_FASTBUILD_CACHE_PATH` variable or the
  24. ``FASTBUILD_CACHE_PATH`` environment variable.
  25. Then build with the ``-cache`` flag:
  26. .. code-block:: console
  27. cmake --build <path-to-build> -- -cache
  28. Compiler Behavior Variables
  29. ---------------------------
  30. The following variables control how compiler nodes are emitted in the generated
  31. ``fbuild.bff``. These settings may affect build determinism, debug info paths,
  32. include handling, and compiler argument formatting:
  33. * :variable:`CMAKE_FASTBUILD_ALLOW_RESPONSE_FILE`
  34. * :variable:`CMAKE_FASTBUILD_CLANG_GCC_UPDATE_XLANG_ARG`
  35. * :variable:`CMAKE_FASTBUILD_CLANG_REWRITE_INCLUDES`
  36. * :variable:`CMAKE_FASTBUILD_COMPILER_EXTRA_FILES`
  37. * :variable:`CMAKE_FASTBUILD_FORCE_RESPONSE_FILE`
  38. * :variable:`CMAKE_FASTBUILD_SOURCE_MAPPING`
  39. * :variable:`CMAKE_FASTBUILD_USE_DETERMINISTIC_PATHS`
  40. * :variable:`CMAKE_FASTBUILD_USE_LIGHTCACHE`
  41. * :variable:`CMAKE_FASTBUILD_USE_RELATIVE_PATHS`
  42. Configuration Variables
  43. -----------------------
  44. The following variables can be used to configure this generator:
  45. * :variable:`CMAKE_FASTBUILD_CACHE_PATH`
  46. * :variable:`CMAKE_FASTBUILD_CAPTURE_SYSTEM_ENV`
  47. * :variable:`CMAKE_FASTBUILD_ENV_OVERRIDES`
  48. * :variable:`CMAKE_FASTBUILD_IDE_ARGS`
  49. * :variable:`CMAKE_FASTBUILD_TRACK_BYPRODUCTS_AS_OUTPUT`
  50. * :variable:`CMAKE_FASTBUILD_VERBOSE_GENERATOR`
  51. Target Properties
  52. -----------------
  53. The following target properties can be used to fine-tune behavior on a
  54. per-target basis:
  55. * :prop_tgt:`FASTBUILD_CACHING` –
  56. disables caching for a specific target.
  57. * :prop_tgt:`FASTBUILD_DISTRIBUTION` –
  58. disables distributed compilation for a specific target.
  59. Notes
  60. -----
  61. * This generator does not support directories as outputs of custom commands.
  62. If you do specify a directory as an output, it should be marked with the
  63. ``SYMBOLIC`` property to avoid incorrect behavior.
  64. * It is highly advised to use custom commands with only one output.
  65. If multiple outputs are specified, the generator will emit an additional
  66. rule to check the outputs at build time. This adds overhead and is necessary
  67. because FASTBuild natively supports only a single output per custom step.
  68. Example
  69. -------
  70. .. code-block:: shell
  71. cmake [<options>] -G FASTBuild -B <path-to-build> -DCMAKE_BUILD_TYPE=Release
  72. cmake --build <path-to-build> --target my_app
  73. This generates ``fbuild.bff`` in ``<path-to-build>`` and uses FASTBuild
  74. to build the ``my_app`` target.
  75. See Also
  76. --------
  77. * :manual:`cmake-generators(7)`
  78. * `FASTBuild Documentation <https://www.fastbuild.org/docs/documentation.html>`_