|
369 | 369 | -- get ninja
|
370 | 370 | function _get_ninja(package)
|
371 | 371 | local ninja = find_tool("ninja")
|
372 |
| - assert(ninja, "ninja not found!") |
373 |
| - return ninja.program |
| 372 | + if ninja then |
| 373 | + return ninja.program |
| 374 | + end |
374 | 375 | end
|
375 | 376 |
|
376 | 377 | -- https://github.com/xmake-io/xmake-repo/pull/1096
|
@@ -771,10 +772,8 @@ function _get_configs_for_generator(package, configs, opt)
|
771 | 772 | table.insert(configs, "-G")
|
772 | 773 | table.insert(configs, _get_cmake_generator_for_msvc(package))
|
773 | 774 | elseif package:is_plat("wasm") and is_subhost("windows") then
|
774 |
| - if not find_tool("ninja") then |
775 |
| - table.insert(configs, "-G") |
776 |
| - table.insert(configs, "MinGW Makefiles") |
777 |
| - end |
| 775 | + table.insert(configs, "-G") |
| 776 | + table.insert(configs, "MinGW Makefiles") |
778 | 777 | else
|
779 | 778 | table.insert(configs, "-G")
|
780 | 779 | table.insert(configs, "Unix Makefiles")
|
@@ -1152,8 +1151,8 @@ function _get_cmake_generator(package, opt)
|
1152 | 1151 | if package:has_tool("cc", "clang_cl") or package:has_tool("cxx", "clang_cl") then
|
1153 | 1152 | cmake_generator = "Ninja"
|
1154 | 1153 | elseif is_subhost("windows") and package:is_plat("mingw", "wasm") then
|
1155 |
| - local mingw_make = _get_mingw32_make(package) |
1156 |
| - if not mingw_make and find_tool("ninja") then |
| 1154 | + local ninja = _get_ninja(package) |
| 1155 | + if ninja then |
1157 | 1156 | cmake_generator = "Ninja"
|
1158 | 1157 | end
|
1159 | 1158 | end
|
|
0 commit comments