How would I go about adding a compiler option to emscripten for building to html5?
I want to add the --bind option to the emcc call when building for html5, would I add this in html5toolchain.cs? I'm just trying to use the embind, specifically the val functionality.
asked Oct 24 '17 at 02:42 PM in Packaging & Deployment
I think there is currently no machinery to allow adding in custom Emscripten linker flags. You can achieve it if you compile UE4 from sources at GitHub. If doing that, go and edit the file Engine/Source/Programs/UnrealBuildTool/HTML5/HTML5ToolChain.cs, and find the function GetLinkArguments(), and add in --bind flag there.
Another way, which might be simpler if you're using a precompiled UE4 package, might be to go and hack the emcc.py script in the bundled compiler. Find the emcc.py file inside UE4 installation directory, and add e.g. on this line https://github.com/kripken/emscripten/blob/incoming/emcc.py#L1861 a directive
or something like that, to force the --bind flag to be present in UE4 link. Then try doing a full rebuild. Not sure if this will work, but it's probably so quick to test that it might be preferable if you don't currently have the sources installed.
answered Oct 24 '17 at 05:08 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here