diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-04-01 15:19:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-01 15:19:27 +0200 |
commit | 21809924600a7d6608ba0f2d098ee3ae30f64834 (patch) | |
tree | 54cd6a8b36740bdd98a4f9dea6c6290ec3d15d59 /icebram | |
parent | 9b0603c4bc156b350918c3a8762ffac28b3de42b (diff) | |
parent | 3bee3cfeadcb57833a90c7789333750676f39e81 (diff) | |
download | icestorm-21809924600a7d6608ba0f2d098ee3ae30f64834.tar.gz icestorm-21809924600a7d6608ba0f2d098ee3ae30f64834.tar.bz2 icestorm-21809924600a7d6608ba0f2d098ee3ae30f64834.zip |
Merge pull request #108 from rqou/master
Better emscripten support
Diffstat (limited to 'icebram')
-rw-r--r-- | icebram/icebram.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/icebram/icebram.cc b/icebram/icebram.cc index 245a0ab..a796f92 100644 --- a/icebram/icebram.cc +++ b/icebram/icebram.cc @@ -28,6 +28,10 @@ #include <fstream> #include <iostream> +#ifdef __EMSCRIPTEN__ +#include <emscripten.h> +#endif + using std::map; using std::pair; using std::vector; @@ -109,6 +113,18 @@ void help(const char *cmd) int main(int argc, char **argv) { +#ifdef __EMSCRIPTEN__ + EM_ASM( + if (ENVIRONMENT_IS_NODE) + { + FS.mkdir('/hostcwd'); + FS.mount(NODEFS, { root: '.' }, '/hostcwd'); + FS.mkdir('/hostfs'); + FS.mount(NODEFS, { root: '/' }, '/hostfs'); + } + ); +#endif + bool verbose = false; bool generate = false; |