Skip to content

improve emscripten detection by including emcc.py search#6304

Merged
waruqi merged 1 commit intoxmake-io:devfrom
Doekin:emscripten
Apr 10, 2025
Merged

improve emscripten detection by including emcc.py search#6304
waruqi merged 1 commit intoxmake-io:devfrom
Doekin:emscripten

Conversation

@Doekin
Copy link
Contributor

@Doekin Doekin commented Apr 9, 2025

The emscripten package in the APT repository does not include emsdk.py, leading to detection issues in xmake.

This PR improves detection by also searching for emcc.py, which aids in locating the installed emscripten. However, specifying the emsdk path may still be necessary. For example:

  • On Debian: xmake g --emsdk=/usr/share/emscripten/
  • On Arch: xmake g --emsdk=/usr/lib/emscripten

(Note: The emscripten installation path may change in the future, so the paths mentioned here might become outdated.)

#6298

if emcc then
emscripten = path.directory(emcc)
elseif find_file("emcc.py", sdkdir) then
emscripten = sdkdir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    local emcc = find_file("emcc", sdkdir, {suffixes = subdirs})
    if not emcc then
        emcc = find_file("emcc.py", sdkdir)
    end
    if emcc then

@waruqi
Copy link
Member

waruqi commented Apr 10, 2025

  • On Debian: xmake g --emsdk=/usr/share/emscripten/
  • On Arch: xmake g --emsdk=/usr/lib/emscripten

(Note: The emscripten installation path may change in the future, so the paths mentioned here might become outdated.)

We can add some default search paths here.

if is_host("linux") then
    table.insert(paths, "/usr/share/emscripten")
end

table.insert(paths, "$(env EMSDK)")

@waruqi waruqi added this to the v3.0.0 milestone Apr 10, 2025
@waruqi waruqi merged commit cf36a2d into xmake-io:dev Apr 10, 2025
22 checks passed
@Doekin Doekin deleted the emscripten branch May 16, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants