summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorDoekin <[email protected]>2025-04-10 09:23:48 +0800
committerDoekin <[email protected]>2025-04-10 09:23:48 +0800
commitcf75a18fc72cf469a3cfc9aa5ff550deb2b29c27 (patch)
treedec57228997188a55fcc3379cda315be169dd017 /xmake/modules
parentd9a5ab70746010c846b815c2b5e14447d268b96f (diff)
improve `emscripten` detection by including `emcc.py` search
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/sdks/find_emsdk.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/detect/sdks/find_emsdk.lua b/xmake/modules/detect/sdks/find_emsdk.lua
index cbc6998b2..ec8553692 100644
--- a/xmake/modules/detect/sdks/find_emsdk.lua
+++ b/xmake/modules/detect/sdks/find_emsdk.lua
@@ -33,10 +33,17 @@ function _find_emsdkdir(sdkdir)
table.insert(paths, sdkdir)
end
table.insert(paths, "$(env EMSDK)")
+ if is_host("linux") then
+ table.join2(paths, {"/usr/share/emscripten/", "/usr/lib/emscripten/"})
+ end
local emsdk = find_file("emsdk.py", paths, {suffixes = subdirs})
if emsdk then
return path.directory(emsdk)
end
+ local emcc_py = find_file("emcc.py", paths, {suffixes = subdirs})
+ if emcc_py then
+ return path.directory(emcc_py)
+ end
end
-- find emsdk
@@ -53,6 +60,7 @@ function _find_emsdk(sdkdir)
local subdirs = {}
table.insert(subdirs, path.join("*", "emscripten"))
local emcc = find_file("emcc", sdkdir, {suffixes = subdirs})
+ emcc = emcc or find_file("emcc.py", sdkdir)
if emcc then
emscripten = path.directory(emcc)
end