Ninja.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Ninja
  2. -----
  3. Generates ``build.ninja`` files.
  4. A ``build.ninja`` file is generated into the build tree. Use the ninja
  5. program to build the project through the ``all`` target and install the
  6. project through the ``install`` (or ``install/strip``) target.
  7. For each subdirectory ``sub/dir`` of the project, additional targets
  8. are generated:
  9. ``sub/dir/all``
  10. .. versionadded:: 3.6
  11. Depends on all targets required by the subdirectory.
  12. ``sub/dir/install``
  13. .. versionadded:: 3.7
  14. Runs the install step in the subdirectory, if any.
  15. ``sub/dir/install/strip``
  16. .. versionadded:: 3.7
  17. Runs the install step in the subdirectory followed by a ``CMAKE_STRIP`` command,
  18. if any.
  19. The ``CMAKE_STRIP`` variable will contain the platform's ``strip`` utility, which
  20. removes symbols information from generated binaries.
  21. ``sub/dir/test``
  22. .. versionadded:: 3.7
  23. Runs the test step in the subdirectory, if any.
  24. ``sub/dir/package``
  25. .. versionadded:: 3.7
  26. Runs the package step in the subdirectory, if any.
  27. Fortran Support
  28. ^^^^^^^^^^^^^^^
  29. .. versionadded:: 3.7
  30. The ``Ninja`` generator conditionally supports Fortran when the ``ninja``
  31. tool is at least version 1.10 (which has the required features).
  32. Swift Support
  33. ^^^^^^^^^^^^^
  34. .. versionadded:: 3.15
  35. The Swift support is experimental, not considered stable, and may change
  36. in future releases of CMake.
  37. See Also
  38. ^^^^^^^^
  39. .. versionadded:: 3.17
  40. The :generator:`Ninja Multi-Config` generator is similar to the ``Ninja``
  41. generator, but generates multiple configurations at once.