While Chad does indeed use clang + emcc ... I think you can use emcc for the first stage, just indicate that you want the output file to be .bc and emcc won't go and run everything on it:
emcc -o whatever.bc -c whatever.cpp ... Try it out! - Bruce On Tue, Sep 16, 2014 at 3:32 PM, Robert Tweed <fistful.of.spann...@gmail.com > wrote: > I'm using emcc for both stages. I didn't know you could use clang > directly. Which options are you using? Do you just add emscripten's include > directory to the include path so it can find emscripten.h, or is there a > lot more to do besides that to make it work? > > - Robert > > On 15/09/2014 19:16, Chad Austin wrote: > > Are you using emcc or clang to do the .cpp -> .bc compilation? If you > use clang directly, you may have some additional control over the build > options. > > We do exactly what it sounds like you want, but by only invoking emcc at > the final .bc -> .js step. > > > On Mon, Sep 15, 2014 at 3:59 AM, Robert Tweed < > fistful.of.spann...@gmail.com> wrote: > >> Hi list, >> >> Using make, I want to be able to produce two different versions of the >> final output JS: one completely optimised and minified; the other that is >> fully indented, commented and readable. >> >> Ideally, I would run a compile step from *.cpp -> *.bc, then I would run >> a link step which specifies the optimisation level for that target (either >> full, or none). But, there's a problem with that. >> >> If I compile the intermediate step without the -O2 option, my final >> "optimised and minified" script is about 500K (this is with options "-O2 >> --closure 1" in the link step). OTOH, if I do include the -O2 option in the >> first compile pass, my output is down to 100K (quite a significant >> difference) but my "fully readable" script is now minified as well. >> >> Is there any way around this without having to compile from scratch each >> time, or maintain two separate sets of intermediate files (which largely >> defeats the purpose)? >> >> TIA, >> >> - Robert >> >> -- >> 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 emscripten-discuss+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Chad Austin > Technical Director, IMVU > http://engineering.imvu.com <http://www.imvu.com/members/Chad/> > http://chadaustin.me > > > -- > 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 emscripten-discuss+unsubscr...@googlegroups.com. > 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 emscripten-discuss+unsubscr...@googlegroups.com. > 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 emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.