Ninja.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. Ninja
  2. -----
  3. Generates a ``build.ninja`` file into the build tree.
  4. Builtin Targets
  5. ^^^^^^^^^^^^^^^
  6. ``all``
  7. Depends on all targets required by the project, except those with
  8. :prop_tgt:`EXCLUDE_FROM_ALL` set to true.
  9. ``install``
  10. Runs the install step.
  11. ``install/strip``
  12. .. versionadded:: 3.7
  13. Runs the install followed by a ``CMAKE_STRIP`` command, if any.
  14. The ``CMAKE_STRIP`` variable will contain the platform's ``strip`` utility, which
  15. removes symbols information from generated binaries.
  16. ``install/parallel``
  17. .. versionadded:: 3.30
  18. Created only if the :prop_gbl:`INSTALL_PARALLEL` global property is ``ON``.
  19. Runs the install step for each subdirectory independently and in parallel.
  20. For each subdirectory ``sub/dir`` of the project, additional targets
  21. are generated:
  22. ``sub/dir/all``
  23. .. versionadded:: 3.6
  24. Depends on all targets required by the subdirectory.
  25. ``sub/dir/install``
  26. .. versionadded:: 3.7
  27. Runs the install step in the subdirectory, if any.
  28. ``sub/dir/install/strip``
  29. .. versionadded:: 3.7
  30. Runs the install step in the subdirectory followed by a ``CMAKE_STRIP`` command,
  31. if any.
  32. ``sub/dir/test``
  33. .. versionadded:: 3.7
  34. Runs the test step in the subdirectory, if any.
  35. ``sub/dir/package``
  36. .. versionadded:: 3.7
  37. Runs the package step in the subdirectory, if any.
  38. Fortran Support
  39. ^^^^^^^^^^^^^^^
  40. .. versionadded:: 3.7
  41. The ``Ninja`` generator conditionally supports Fortran when the ``ninja``
  42. tool is at least version 1.10 (which has the required features).
  43. Swift Support
  44. ^^^^^^^^^^^^^
  45. .. versionadded:: 3.15
  46. The Swift support is experimental, not considered stable, and may change
  47. in future releases of CMake.
  48. See Also
  49. ^^^^^^^^
  50. .. versionadded:: 3.17
  51. The :generator:`Ninja Multi-Config` generator is similar to the ``Ninja``
  52. generator, but generates multiple configurations at once.