Currently not, JS libraries are just noticed when doing the final build from bitcode to JS. We would need to add quite a bit of metadata tracking to support anything else, handle linking of JS libraries, etc. How they work is we do all the normal C linking stuff, then when all that is done, check remaining missing symbols in the JS libraries - a very simple model, basically.
- Alon On Thu, Sep 11, 2014 at 4:11 PM, Nicholas Wilson < [email protected]> wrote: > Hi, > > We are building a rather large project with emscripten using cmake. It's > all pretty good, but I have one niggle about the build process. Our > application is split up into libraries with about thirty to fifty object > files each, and some of the low-level ones are OS wrappers, providing an > abstraction of Windows/Unix/Mac behaviour, and now we've added emscripten > as an OS (our AppLoop class for example needs its own AppLoopImpl for > emscripten, to sit alongside the implementations using select() on Unix, > CFRunLoop on Mac, and MsgWaitForMultipleObjects on Win). > > Unfortunately, it doesn't seem to be possible to add JS libraries to a > ".a" archive, unless I'm invoking it incorrectly? We have to pass > "--js-library" for each one to the linker at the end, but it's awkward > propagating all the filenames from the cmake subprojects to the final link > line. > > Would it be possible for emar to just stuff the JS files in to our static > libraries alongside the bitcode objects? The linker can then pull them out > at the other end of the process and add them to its list of additional > libraries. The emar wrapper is just python, easy to modify without having > to delve into the internals of anything, so it can do anything it likes to > pretend that .js files are just pre-compiled objects of a special form that > can indeed be added to an archive. We could use ".pre.js" and ".post.js" as > the extensions to indicate preamble and postable code. > > That would also greatly simply the dependency tracking in the current > cmake macros emscripten supplies (em_link_js_library), which uses some odd > hacks to get incremental builds to work. > > This is just an idea; I haven't quite thought whether or not it would work. > > Nick > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
