@@ -366,6 +366,13 @@ function _get_mingw32_make(package)
366
366
end
367
367
end
368
368
369
+ -- get ninja
370
+ function _get_ninja (package )
371
+ local ninja = find_tool (" ninja" )
372
+ assert (ninja , " ninja not found!" )
373
+ return ninja .program
374
+ end
375
+
369
376
-- https://github.com/xmake-io/xmake-repo/pull/1096
370
377
function _fix_cxx_compiler_cmake (package , envs )
371
378
local cxx = envs .CMAKE_CXX_COMPILER
@@ -608,9 +615,10 @@ function _get_configs_for_wasm(package, configs, opt)
608
615
table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. mingw_make )
609
616
end
610
617
else
611
- local ninja = find_tool (" ninja" )
612
- assert (ninja , " ninja not found!" )
613
- table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. ninja .program )
618
+ local ninja = _get_ninja (package )
619
+ if ninja then
620
+ table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. ninja )
621
+ end
614
622
end
615
623
end
616
624
_get_configs_for_generic (package , configs , opt )
@@ -768,7 +776,6 @@ function _get_configs_for_generator(package, configs, opt)
768
776
table.insert (configs , " -G" )
769
777
if find_tool (" ninja" ) then
770
778
table.insert (configs , " Ninja" )
771
- opt .cmake_generator = " Ninja"
772
779
else
773
780
table.insert (configs , " MinGW Makefiles" )
774
781
end
@@ -1148,7 +1155,7 @@ function _get_cmake_generator(package, opt)
1148
1155
if not cmake_generator then
1149
1156
if package :has_tool (" cc" , " clang_cl" ) or package :has_tool (" cxx" , " clang_cl" ) then
1150
1157
cmake_generator = " Ninja"
1151
- elseif is_subhost (" windows" ) and package :is_plat (" mingw" ) then
1158
+ elseif is_subhost (" windows" ) and ( package :is_plat (" mingw" , " wasm " ) ) then
1152
1159
local mingw_make = _get_mingw32_make (package )
1153
1160
if not mingw_make and find_tool (" ninja" ) then
1154
1161
cmake_generator = " Ninja"
@@ -1220,7 +1227,6 @@ end
1220
1227
-- install package
1221
1228
function install (package , configs , opt )
1222
1229
opt = opt or {}
1223
- _get_configs_for_generator (package , configs , opt )
1224
1230
1225
1231
local cmake_generator = _get_cmake_generator (package , opt )
1226
1232
-- enter build directory
0 commit comments