From 3bee3cfeadcb57833a90c7789333750676f39e81 Mon Sep 17 00:00:00 2001 From: Robert Ou Date: Wed, 15 Nov 2017 03:14:14 -0800 Subject: Mount NODEFS if using emscripten and nodejs Mounts root directory on `/hostfs` and the current working directory on `/hostcwd` --- icepll/icepll.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'icepll/icepll.cc') diff --git a/icepll/icepll.cc b/icepll/icepll.cc index b123f32..82bf3e3 100644 --- a/icepll/icepll.cc +++ b/icepll/icepll.cc @@ -20,6 +20,10 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif + const char *binstr(int v, int n) { static char buffer[16]; @@ -63,6 +67,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 + double f_pllin = 12; double f_pllout = 60; bool simple_feedback = true; -- cgit v1.2.3