FASTBuild.rst 3.3 KB

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