summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorChi Huu Huynh <[email protected]>2024-08-29 01:31:31 +0100
committerChi Huu Huynh <[email protected]>2024-08-29 01:31:31 +0100
commitfb1ac8a218a8f064826e937d074f008b08a47c09 (patch)
tree64a90da3ab74e39ae74c87098038f08cac8e5011 /xmake/modules
parent2a2ee54fe65cd4035bc25b01391e63170c952c38 (diff)
fix windows wasm compilation with packages
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/tools/cmake.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 99dfe0436..38b25db51 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -601,10 +601,16 @@ function _get_configs_for_wasm(package, configs, opt)
local emscripten_cmakefile = find_file("Emscripten.cmake", path.join(emsdk.emscripten, "cmake/Modules/Platform"))
assert(emscripten_cmakefile, "Emscripten.cmake not found!")
table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile)
- if is_subhost("windows") and opt.cmake_generator ~= "Ninja" then
- local mingw_make = _get_mingw32_make(package)
- if mingw_make then
- table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make)
+ 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
+ local ninja = find_tool("ninja")
+ assert(ninja, "ninja not found!")
+ table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. ninja.program)
end
end
_get_configs_for_generic(package, configs, opt)
@@ -1214,8 +1220,9 @@ end
-- install package
function install(package, configs, opt)
opt = opt or {}
- local cmake_generator = _get_cmake_generator(package, opt)
+ _get_configs(package, configs, opt)
+ local cmake_generator = _get_cmake_generator(package, opt)
-- enter build directory
local buildir = opt.buildir or package:buildir()
os.mkdir(path.join(buildir, "install"))