summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/find_emrun.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/detect/tools/find_emrun.lua')
-rw-r--r--xmake/modules/detect/tools/find_emrun.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/xmake/modules/detect/tools/find_emrun.lua b/xmake/modules/detect/tools/find_emrun.lua
index ac210c4ca..6a96c9d82 100644
--- a/xmake/modules/detect/tools/find_emrun.lua
+++ b/xmake/modules/detect/tools/find_emrun.lua
@@ -51,9 +51,26 @@ function main(opt)
table.insert(paths, emsdk.emscripten)
opt.paths = paths
end
-
+
-- find program
- local program = find_program(opt.program or (is_host("windows") and "emrun.bat" or "emrun"), opt)
+ -- emsdk 6.0.0+ ships .exe on windows, older releases ship .bat
+ local program
+ if opt.program then
+ program = find_program(opt.program, opt)
+ else
+ local candidate_names
+ if is_host("windows") then
+ candidate_names = {"emrun.exe", "emrun.bat"}
+ else
+ candidate_names = {"emrun"}
+ end
+ for _, name in ipairs(candidate_names) do
+ program = find_program(name, opt)
+ if program then
+ break
+ end
+ end
+ end
-- find program version
local version = nil