emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
3k stars 684 forks source link

Feature request: allow alternate location for ~/.emscripten on 'emsdk install' #24

Closed floooh closed 9 years ago

floooh commented 9 years ago

It would be nice if we could provide an alternate location for the .emscripten file at install with an additional '--' option (e.g. "./emsdk install --em-config ~/bla/blub/.emscripten sdk-incoming-64bit").

This would be an advanced option for people who use their own build systems or who want to have multiple emscripten SDKs installed in parallel. In my case it's about this build system and engine: http://github.com/floooh/fips and http://github.com/floooh/oryol, I have my own cmake toolchain file which would then add a --em-config to the emcc call.

The other missing feature preventing multiple SDK install was to provide a separate .emscripten_cache directory, I'm not sure whether this is already implemented in emscripten itself, @waywardmonkeys stumbled over this a little while ago.

juj commented 9 years ago

Both features sound good. I'll think about this a bit to feel out what would be the best method to implement it.

juj commented 9 years ago

I resolved this now with a --embedded command line option to emsdk activate, which has the effect of generating the necessary configuration inside the emsdk root directory. See https://github.com/juj/emsdk/commit/ef17aeb6166519385bfb895cd6220c31d62ecb2f . Let me know if that solution is suitable, or if there's still something that is still missing.

floooh commented 9 years ago

Nice, thanks! I'll give a whirl over the weekend and report back :)

floooh commented 9 years ago

It seems to work nicely, in my cmake toolchain file I'm first trying to find the .emscripten file in the emsdk directory, and if present call emcc with --em-config and --cache. If not I assume the ~/.emscripten exists and call emcc as usual.

After going back to the incoming branch I stumbled over this bug though (unrelated): https://github.com/kripken/emscripten/issues/3149

Can you tell when this will be available in the emsdk via ./emsdk update?

juj commented 9 years ago

Great to hear. I'm working on getting a new emsdk update out this weekend, so it should be very soon.