diff options
| author | Jérôme Leclercq <[email protected]> | 2022-12-03 18:13:53 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-03 18:13:53 +0100 |
| commit | d0ce4ec4c9a7f208a83c51eb7555bdb3859aff59 (patch) | |
| tree | 37551c01f93da871673eef070db7549f6e55e082 | |
| parent | 09113b27d3b5749b09716e8e0ec6c766b4662bd5 (diff) | |
improve cmake generator with wasm (uses mingw make)
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 40437a1c7..3304cf90b 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -483,6 +483,10 @@ function _get_configs_for_wasm(package, configs, opt) table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile) end assert(emscripten_cmakefile, "Emscripten.cmake not found!") + if is_subhost("windows") then + local mingw = assert(package:build_getenv("mingw") or package:build_getenv("sdk"), "mingw not found!") + table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. _translate_paths(path.join(mingw, "bin", "mingw32-make.exe"))) + end _get_configs_for_generic(package, configs, opt) end @@ -645,6 +649,9 @@ function _get_configs_for_generator(package, configs, opt) elseif package:is_plat("windows") then table.insert(configs, "-G") table.insert(configs, _get_cmake_generator_for_msvc(package)) + elseif package:is_plat("wasm") and is_subhost("windows") then + table.insert(configs, "-G") + table.insert(configs, "MinGW Makefiles") else table.insert(configs, "-G") table.insert(configs, "Unix Makefiles") @@ -841,7 +848,7 @@ function _install_for_make(package, configs, opt) if is_host("bsd") then os.vrunv("gmake", argv) os.vrunv("gmake", {"install"}) - elseif is_subhost("windows") and package:is_plat("mingw") then + elseif is_subhost("windows") and package:is_plat("mingw", "wasm") then local mingw = assert(package:build_getenv("mingw") or package:build_getenv("sdk"), "mingw not found!") local mingw_make = path.join(mingw, "bin", "mingw32-make.exe") os.vrunv(mingw_make, argv) |
