Working with a codebase which supports building for multiple Operating Systems, it is only sensible, where modifications for Emscripten are required, to integrate them into the same codebase, with the assistance of conditional compilation to let it continue to work in other environments.
There doesn't seem to be any documentation on the topic, though, which seems very poor to me, nor can I find any questions about it, which seems very surprising to me—I expected it to be well-trodden and -documented territory.
How can I do this?
(I have looked at tools/shared.py
, this seems to suggest that #ifdef EMSCRIPTEN
or #ifdef __EMSCRIPTEN__
could be used; I'm still asking this question to determine if I am correct, if this is the correct way of doing it, perhaps even which should be used.)