Skip to content

Commit d7057eb

Browse files
committed
add requested changes
1 parent 760ccdd commit d7057eb

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

xmake/modules/package/tools/cmake.lua

+7-13
Original file line numberDiff line numberDiff line change
@@ -609,16 +609,16 @@ function _get_configs_for_wasm(package, configs, opt)
609609
assert(emscripten_cmakefile, "Emscripten.cmake not found!")
610610
table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile)
611611
if is_subhost("windows") then
612-
if opt.cmake_generator ~= "Ninja" then
613-
local mingw_make = _get_mingw32_make(package)
614-
if mingw_make then
615-
table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make)
616-
end
617-
else
612+
if opt.cmake_generator == "Ninja" then
618613
local ninja = _get_ninja(package)
619614
if ninja then
620615
table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. ninja)
621616
end
617+
else
618+
local mingw_make = _get_mingw32_make(package)
619+
if mingw_make then
620+
table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make)
621+
end
622622
end
623623
end
624624
_get_configs_for_generic(package, configs, opt)
@@ -771,14 +771,8 @@ function _get_configs_for_generator(package, configs, opt)
771771
table.insert(configs, "-G")
772772
table.insert(configs, _get_cmake_generator_for_msvc(package))
773773
elseif package:is_plat("wasm") and is_subhost("windows") then
774-
-- we attempt to use ninja if it exist
775-
-- @see https://github.com/xmake-io/xmake/issues/3771
776774
table.insert(configs, "-G")
777-
if find_tool("ninja") then
778-
table.insert(configs, "Ninja")
779-
else
780-
table.insert(configs, "MinGW Makefiles")
781-
end
775+
table.insert(configs, "MinGW Makefiles")
782776
else
783777
table.insert(configs, "-G")
784778
table.insert(configs, "Unix Makefiles")

0 commit comments

Comments
 (0)