webatintel / aquarium

BSD 3-Clause "New" or "Revised" License
24 stars 7 forks source link

Explore the way to use Emscripten in the GN world #103

Open hujiajie opened 4 years ago

hujiajie commented 4 years ago

The rough idea is to export conventional environment variables like CC and CXX for Emscripten, use getenv() to define the commands and flags of a custom toolchain, and then one can override the default toolchain with the help of custom_toolchain.

Some early experiment shows that a bunch of GN args may be needed apart from custom_toolchain, due to the incompatibility between Emscripten and Clang/GCC. That is to say, the Emscripten build will not be supported as perfect as native builds.

Our current main trouble is that the exsitence of libatomic and its friends is assumed in //build, while Emscripten uses musl and there's a longstanding known issue that only a monolithic libc is shipped. Therefore, an Emscripten side patch is expected.