FASTBuild.rst 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_TRACK_BYPRODUCTS_AS_OUTPUT`
  49. * :variable:`CMAKE_FASTBUILD_VERBOSE_GENERATOR`
  50. Target Properties
  51. -----------------
  52. The following target properties can be used to fine-tune behavior on a
  53. per-target basis:
  54. * :prop_tgt:`FASTBUILD_CACHING` –
  55. disables caching for a specific target.
  56. * :prop_tgt:`FASTBUILD_DISTRIBUTION` –
  57. disables distributed compilation for a specific target.
  58. Notes
  59. -----
  60. * This generator does not support directories as outputs of custom commands.
  61. If you do specify a directory as an output, it should be marked with the
  62. ``SYMBOLIC`` property to avoid incorrect behavior.
  63. * It is highly advised to use custom commands with only one output.
  64. If multiple outputs are specified, the generator will emit an additional
  65. rule to check the outputs at build time. This adds overhead and is necessary
  66. because FASTBuild natively supports only a single output per custom step.
  67. Example
  68. -------
  69. .. code-block:: shell
  70. cmake [<options>] -G FASTBuild -B <path-to-build> -DCMAKE_BUILD_TYPE=Release
  71. cmake --build <path-to-build> --target my_app
  72. This generates ``fbuild.bff`` in ``<path-to-build>`` and uses FASTBuild
  73. to build the ``my_app`` target.
  74. See Also
  75. --------
  76. * :manual:`cmake-generators(7)`
  77. * `FASTBuild Documentation <https://www.fastbuild.org/docs/documentation.html>`_