Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dynamic libraries in Emscripten #203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for dynamic libraries in Emscripten #203

wants to merge 2 commits into from

Conversation

pixelherodev
Copy link
Contributor

No description provided.

@floooh
Copy link
Owner

floooh commented Sep 25, 2018

Thanks, I'll need to test this first on how it affects existing projects (most importantly whether it affects output size in any way).

@floooh floooh self-assigned this Sep 25, 2018
@pixelherodev
Copy link
Contributor Author

I'll see about checking code size - I'm requesting the change, it wouldn't be right to take your time on this. For now, I'm more than happy to use my branch of this.

@floooh
Copy link
Owner

floooh commented Sep 26, 2018

Hmm ok, I'm seeing a few problems on my projects:

  • the Closure compiler cannot run on shared modules: assert not options.use_closure_compiler, 'cannot use closure compiler on shared modules'
  • the settings.js docs in the emscripten SDK says that with -s LINKABLE=1, no dead code elimination will be performed, this will increase code size in many cases

I guess the proper solution would be to put the shared-module support behind a CMake option which is off by default.

I'll keep this PR open, and when I have time try to take care of it. It will be a little while until I'll find time for this though :)

@pixelherodev
Copy link
Contributor Author

I see why LINKABLE should be an option, but why would the first one be a problem? It only affects shared modules which don't work without this anyways.

@floooh
Copy link
Owner

floooh commented Sep 28, 2018

For the first point (about the Closure compiler not working):

I think the proper solution would be to put the shared module settings behind a cmake option, so that they can be switched on/off (e.g. if I want to use the Closure compiler, I would switch the shared module settings off).

My build failed even without building shared modules, which is a bit odd.

Maybe we need (at least) 2 cmake options (build shared modules, and use shared module)...

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