summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorChi Huu Huynh <[email protected]>2024-08-29 15:35:36 +0100
committerChi Huu Huynh <[email protected]>2024-08-29 15:35:36 +0100
commitd7057eb144be99f09f18427e92eee52ccafc318f (patch)
tree2c342dd666bb4fec7fe6f0e41988b2b2c14b49d2 /xmake/modules/package/tools/cmake.lua
parent760ccdd1beb3673ed282f75bb630f3ecdbcfabd3 (diff)
add requested changes
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua20
1 files changed, 7 insertions, 13 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 9b4a01436..8b1575d2e 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -609,16 +609,16 @@ function _get_configs_for_wasm(package, configs, opt)
assert(emscripten_cmakefile, "Emscripten.cmake not found!")
table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile)
if is_subhost("windows") then
- if opt.cmake_generator ~= "Ninja" then
- local mingw_make = _get_mingw32_make(package)
- if mingw_make then
- table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make)
- end
- else
+ if opt.cmake_generator == "Ninja" then
local ninja = _get_ninja(package)
if ninja then
table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. ninja)
end
+ else
+ local mingw_make = _get_mingw32_make(package)
+ if mingw_make then
+ table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make)
+ end
end
end
_get_configs_for_generic(package, configs, opt)
@@ -771,14 +771,8 @@ function _get_configs_for_generator(package, configs, opt)
table.insert(configs, "-G")
table.insert(configs, _get_cmake_generator_for_msvc(package))
elseif package:is_plat("wasm") and is_subhost("windows") then
- -- we attempt to use ninja if it exist
- -- @see https://github.com/xmake-io/xmake/issues/3771
table.insert(configs, "-G")
- if find_tool("ninja") then
- table.insert(configs, "Ninja")
- else
- table.insert(configs, "MinGW Makefiles")
- end
+ table.insert(configs, "MinGW Makefiles")
else
table.insert(configs, "-G")
table.insert(configs, "Unix Makefiles")