summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/find_emcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-07-19 23:12:24 +0800
committerGitHub <[email protected]>2026-07-19 23:12:24 +0800
commitc5874deb17f61381d14a6e148488d61c63c8f78f (patch)
tree1e0d0db4906b060d5376153c1416347344ec52e3 /xmake/modules/detect/tools/find_emcc.lua
parent64439096a06b65556fff59f3b0b4e6a439b44129 (diff)
parent5895b1d179e31a9d41a145159399a7f5cfd5b7bb (diff)
Merge pull request #7659 from ifarbod/ifarbod/fix-emcc-detectionHEADdev
refactor emcc detection to support both .exe and .bat on windows
Diffstat (limited to 'xmake/modules/detect/tools/find_emcc.lua')
-rw-r--r--xmake/modules/detect/tools/find_emcc.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/find_emcc.lua b/xmake/modules/detect/tools/find_emcc.lua
index e44223d63..dc77b716e 100644
--- a/xmake/modules/detect/tools/find_emcc.lua
+++ b/xmake/modules/detect/tools/find_emcc.lua
@@ -50,7 +50,24 @@ function main(opt)
end
-- find program
- local program = find_program(opt.program or (is_host("windows") and "emcc.bat" or "emcc"), 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 = {"emcc.exe", "emcc.bat"}
+ else
+ candidate_names = {"emcc"}
+ 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