瀏覽代碼

Ninja: Prefer first ninja tool available in PATH

We search for tools `ninja-build`, `ninja`, and `samu` as the build tool
for the Ninja generator.  Re-order the search to prefer whichever tool
appears first in the `PATH`.  This makes it easier for users to control
which tool gets used when more than one is available.

Fixes: #20028
Brad King 6 年之前
父節點
當前提交
feb5cb8d9d
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 7 0
      Help/release/dev/ninja-tool.rst
  2. 1 0
      Modules/CMakeNinjaFindMake.cmake

+ 7 - 0
Help/release/dev/ninja-tool.rst

@@ -0,0 +1,7 @@
+ninja-tool
+----------
+
+* The :generator:`Ninja` generator now prefers the first ninja build
+  tool to appear in the ``PATH`` no matter whether it is called
+  ``ninja-build``, ``ninja``, or ``samu``.  Previously the first
+  of those names to appear anywhere in the ``PATH`` would be preferred.

+ 1 - 0
Modules/CMakeNinjaFindMake.cmake

@@ -4,5 +4,6 @@
 
 find_program(CMAKE_MAKE_PROGRAM
   NAMES ninja-build ninja samu
+  NAMES_PER_DIR
   DOC "Program used to build from build.ninja files.")
 mark_as_advanced(CMAKE_MAKE_PROGRAM)