On review, this isn't quite correct. It wasn't --pre-js that fixed the 
build error, it was moving the export from EXPORTED_FUNCTIONS to 
EXTRA_EXPORTED_RUNTIME_METHODS. So, I don't have any evidence that it's 
finding the methods in the --pre-js file. Adding random names to the 
runtime method list doesn't generate any build-time error.

On Wednesday, April 3, 2019 at 4:39:03 PM UTC-7, Brian Craft wrote:
>
> I haven't been able to find docs or examples for --pre-js. Can anyone 
> point in the right direction?
>
> I worked out that it's "--pre-js=foo.js", not "--pre-js foo.js". I don't 
> understand the module system, though, and can't access the functions 
> defined in the file.
>
> I was expecting that I would add the functions 
> to EXTRA_EXPORTED_RUNTIME_METHODS, and they would appear on Module. This 
> seems to sort of half work: if I add a function 
> to EXTRA_EXPORTED_RUNTIME_METHODS but fail to set --pre-js, the build will 
> cough up an error, like
>
> shared:ERROR: undefined exported function: "fradixSortL16_64"
>
> After adding --pre-js, this build error disappears, so it seems to be 
> finding the function during build, but the function is not available at run 
> time on Module.
>

-- 
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.

Reply via email to