Skip to content

Look for emcc in the path as a last resort - #8

Closed
rune-scape wants to merge 2 commits into
mosra:masterfrom
rune-scape:emscripten-find
Closed

Look for emcc in the path as a last resort#8
rune-scape wants to merge 2 commits into
mosra:masterfrom
rune-scape:emscripten-find

Conversation

@rune-scape

Copy link
Copy Markdown
Contributor

both toolchain files call 'find_file(_EMCC emcc)' and if '_EMCC'
exists on the file system, they use its parent folder as
'EMSCRIPTEN_PREFIX'

both toolchain files call 'find_file(_EMCC emcc)' and if  '_EMCC'
exists on the file system, they use its parent folder as
'EMSCRIPTEN_PREFIX'
@rune-scape rune-scape changed the title both emscripten toolchains look for emcc in the path as a last resort Look for emcc in the path as a last resort Sep 13, 2019

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you, this is a very valuable addition as well! 👍

Comment thread generic/Emscripten-wasm.cmake Outdated
set(EMSCRIPTEN_PREFIX "/usr/lib/emscripten")
endif()
unset(_EMCC)
#find_file always sets a cache variable. we dont want this

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think having this variable could be a valid use case, in fact -- imagine having two separate Emscripten installations (for whatever reason) and the toolchain picking the wrong one because its emcc leaked into PATH. Then, to debug this, one could spot the variable being set to an incorrect value (and use EMSCRIPTEN_PREFIX next time). A bit bad is that there's now two ways to do the same thing (either setting EMSCRIPTEN_PREFIX or this _EMCC), but I don't have an immediate idea how to make it better :)

So, alternatively, could the variable be named _EMSCRIPTEN_EMCC_EXECUTABLE and this called on it so it's hidden by default but "inspectable" when one needs to?

mark_as_advanced(_EMSCRIPTEN_EMCC_EXECUTABLE)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're totally right. It slipped my mind that there might be a 'reason' for not being able to disable saving to the cache.

@mosra

mosra commented Sep 20, 2019

Copy link
Copy Markdown
Owner

Merged as 23cd3a4, thank you! :)

I'll be updating the toolchain submodules in all repos gradually with other changes (so not immediately), hope that's okay.

@mosra mosra closed this Sep 20, 2019
@rune-scape

Copy link
Copy Markdown
Contributor Author

Of course, thank you for your hard work on these libraries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants