diff options
| author | Saikari <[email protected]> | 2026-02-23 16:35:05 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-02-23 16:35:05 +0300 |
| commit | f3ab2ca1744900c105e7e789dc099ee4838015d1 (patch) | |
| tree | 792c29223c4075d9d6959f9ec085fffaacea67cc | |
| parent | 25f6f0ce529a29611812558fc6e3d1c9f0fdc9b8 (diff) | |
Refactor WASI platform handling and clean up wasm references in various modules
| -rw-r--r-- | xmake/actions/run/main.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/package/tools/meson.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/tools/go/goenv.lua | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua index 59d7cbe76..8eaa5672f 100644 --- a/xmake/actions/run/main.lua +++ b/xmake/actions/run/main.lua @@ -96,7 +96,8 @@ function _do_run_target(target) -- run wasm target if target:is_plat("wasm") then -- run via wasmtime if using the wasi toolchain, otherwise open in browser - if target:toolchain("wasi") then + local is_wasi = target:toolchain("wasi") or (target:has_tool("cc", "clang") and target:has_tool("ar", "llvm-ar")) + if is_wasi then _run_wasi_target(targetfile, args, {rundir = rundir, addenvs = addenvs, setenvs = setenvs}) else _run_wasm_target_in_browser(targetfile, {rundir = rundir, addenvs = addenvs, setenvs = setenvs}) diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua index 01c12bbe7..fbc6bbe77 100644 --- a/xmake/modules/package/tools/meson.lua +++ b/xmake/modules/package/tools/meson.lua @@ -375,7 +375,7 @@ function _get_configs(package, configs, opt) end -- add cross file - if package:is_cross() or package:is_plat("mingw", "wasm") then + if package:is_cross() or package:is_plat("mingw") then table.insert(configs, "--cross-file=" .. _get_configs_file(package, opt)) elseif package:config("toolchains") then if _is_toolchain_compatible_with_host(package) then diff --git a/xmake/modules/private/tools/go/goenv.lua b/xmake/modules/private/tools/go/goenv.lua index 37a2c27c3..1a448e6f3 100644 --- a/xmake/modules/private/tools/go/goenv.lua +++ b/xmake/modules/private/tools/go/goenv.lua @@ -65,8 +65,7 @@ function GOARCH(arch) ppc64le = "ppc64le", riscv64 = "riscv64", s390x = "s390x", - wasm = "wasm", - wasm32 = "wasm" + wasm = "wasm" } -- try direct match first |
