Skip to content

separate externals as side modules from the main module

Zack Lee requested to merge cuinjune/purr-data:separate_externals into emscripten
  • delete libpd/samples directory
  • add emscripten directory
  • add option to build wasm side modules in externals/Makefile and fix some source files
  • add emscripten target in Makefile and fix l2ork_addons/tar_em_up.sh
  • exclude externals from libpd build
  • add wasm side module loading in pd/src/s_loader.c and clean pd/src/s_inter.c
  • add emscripten/purr-data to .gitignore
  • remove call_external_setup() from libpd/libpd_wrapper/z_libpd.c

After these changes, users can build for emscripten target with make emscripten which will generate emscripten/purr-data/ folder that contains help files, abstractions, and wasm externals. This folder will be preloaded with pdtest.data file so the user can have access to the files inside through the filesystem.

Also, now it is possible for users to build their own wasm external with emcc -Ipd/src NAME.c -s SIDE_MODULE=1 -o NAME.wasm and then dynamically upload the file into the filesystem. These .wasm files will work just like other native external binaries. (e.g. .pd_linux, .pd_darwin)

Edited by Zack Lee

Merge request reports