We have a linker flag -s ENVIRONMENT=x to specify at compile time the
runtime environment that is used. E.g. -s ENVIRONMENT=web generates a
build that is used in a browser only, and -s ENVIRONMENT=node
generates a build that is to be used in node.js only. -s
ENVIRONMENT=web,node generates a build for both.
There is currently no specific flag for React Native, but you can try
expanding the ENVIRONMENT linker flag to add such a target.
pe 12. heinäk. 2019 klo 0.20 laurent bernabe
(laurent...@gmail.com) kirjoitti:
>
> Hi,
>
> My main goal is to adapt this Stockfish chess engine for being used in React Native.
> But in React-Native :
>
> we can't use NODE API such as path/fs ... For this point, I've found a solution : more below,
> we can't rely on Window object and so, nor Document : the original DOM model is forbidden in react-native.
>
> As for removing node js dependency, I've written my own Makefile script . This way, we do not have any call to neither path, nor fs, ...
>
> But I don't know yet how to remove the document/window dependencies. I bet it has something to do with the used Javascript engine when compiling the web assembly.
> But though I've set up some with the JSVU utility, as someone already pointed me in another topic, I don't know how to force emscripten to use one of them, and which one I should use.
>
> Meanwhile, my bet is that SpiderMonkey is a good candidate for that. Am I right ? And how to "bind" a custom JS engine to emscripten ?
>
> Thanks in advance,
>
> Regards
>
> --
> 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+unsub...@googlegroups.com.