-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
We use preprocessing on our JS files. The current implementation is a simple one (with many limitations) in JS. It would be good to be able to run it from python too, so we could use it in more places - right now, for example, we duplicate a few files since the SINGLE_FILE pr landed, as it would need preprocessing from python.
See some debate in #5494 , and also relevant:
- Introduce SUPPORT_SHELL, SUPPORT_NODEJS, SUPPORT_SPIDERMONKEY, SUPPORT_IE11 etc. -s settings #5554
- Gated out #include directives in JS libraries are still included #5458
- relative #include "" directives are treated with respect to $EMSCRIPTEN/src #5457
One proposal was to use the clang preprocessor for everything. The benefit is it's a solid, standard preprocessor we already have. On the other hand it would means we require clang - consider if a language like Rust wanted to just ship Rust + emscripten, it would just need LLVM but not clang.
Alternatively, we could write and maintain a small preprocessor for our purposes, sort of like we do now, but more full-featured and easily usable from both JS and python.