iPlug2 / iPlug2OOS

Template to build an iPlug2 project with CI/CD and publish a WAM to github pages
https://iplug2.github.io/iPlug2OOS/
90 stars 20 forks source link

makedist-web.sh fails if we include "MidiSynth.h" #2

Closed gildurao closed 3 years ago

gildurao commented 3 years ago

Hello,

First of all thank you for sharing your amazing work. I've just started getting into audio plugins and your framework seemed like an interesting place to start

I've been trying to use your containerized approach since I switch between machines often. I followed your documentation but if I include "MidiSynth.h" into the template project, the web build will faill because it cannot find the file (although it exists). Below are the logs.

Logs ``` root@96777a05f568:/workspaces/lmusic/TemplateProject/scripts# ./makedist-web.sh BUNDLING RESOURCES ----------------------------- Remember to build the main file with -s FORCE_FILESYSTEM=1 so that it includes support for loading this file package MAKING - WAM WASM MODULE ----------------------------- make: make --makefile TemplateProject-wam-processor.mk /emsdk/upstream/emscripten/emcc -I/workspaces/lmusic/TemplateProject/projects/.. -I../../iPlug2/Dependencies/IPlug/WAM_SDK/wamsdk -I../../iPlug2/WDL -I../../iPlug2/WDL/swell -I../../iPlug2/IPlug -I../../iPlug2/IPlug/Extras -I../../iPlug2/IPlug/Extras/Faust -I../../iPlug2/IPlug/WEB -I../../iPlug2/IGraphics -I../../iPlug2/IGraphics/Drawing -I../../iPlug2/IGraphics/Controls -I../../iPlug2/IGraphics/Platforms -I../../iPlug2/IGraphics/Extras -I../../iPlug2/Dependencies/IGraphics/NanoVG/src -I../../iPlug2/Dependencies/IGraphics/NanoSVG/src -I../../iPlug2/Dependencies/IGraphics/STB -I../../iPlug2/Dependencies/IGraphics/imgui -I../../iPlug2/Dependencies/IGraphics/imgui/backends -I../../iPlug2/Dependencies/IGraphics/yoga -I../../iPlug2/Dependencies/IGraphics/yoga/yoga -std=c++17 -Wno-bitwise-op-parentheses -DWDL_NO_DEFINE_MINMAX -DNDEBUG=1 -DWAM_API -DIPLUG_DSP=1 -DNO_IGRAPHICS -DSAMPLE_TYPE_FLOAT -s ALLOW_MEMORY_GROWTH=1 --bind -s EXTRA_EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap', 'setValue', 'UTF8ToString']" -s BINARYEN_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 -O0 -s EXPORT_NAME="'AudioWorkletGlobalScope.WAM.TemplateProject'" -s ASSERTIONS=0 -s EXPORTED_FUNCTIONS="[ '_createModule','_wam_init','_wam_terminate','_wam_resize', '_wam_onprocess', '_wam_onmidi', '_wam_onsysex', '_wam_onparam', '_wam_onmessageN', '_wam_onmessageS', '_wam_onmessageA', '_wam_onpatch' ]" -o ../build-web/scripts/TemplateProject-wam.js ../../iPlug2/IPlug/IPlugAPIBase.cpp ../../iPlug2/IPlug/IPlugParameter.cpp ../../iPlug2/IPlug/IPlugPluginBase.cpp ../../iPlug2/IPlug/IPlugPaths.cpp ../../iPlug2/IPlug/IPlugTimer.cpp /workspaces/lmusic/TemplateProject/projects/../TemplateProject.cpp ../../iPlug2/IPlug/WEB/IPlugWAM.cpp ../../iPlug2/Dependencies/IPlug/WAM_SDK/wamsdk/processor.cpp ../../iPlug2/IPlug/IPlugProcessor.cpp /workspaces/lmusic/TemplateProject/projects/../TemplateProject.cpp:3:10: fatal error: 'MidiSynth.h' file not found #include "MidiSynth.h" ^~~~~~~~~~~~~ 1 error generated. emcc: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=16 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -flegacy-pass-manager -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -I/workspaces/lmusic/TemplateProject/projects/.. -I../../iPlug2/Dependencies/IPlug/WAM_SDK/wamsdk -I../../iPlug2/WDL -I../../iPlug2/WDL/swell -I../../iPlug2/IPlug -I../../iPlug2/IPlug/Extras -I../../iPlug2/IPlug/Extras/Faust -I../../iPlug2/IPlug/WEB -I../../iPlug2/IGraphics -I../../iPlug2/IGraphics/Drawing -I../../iPlug2/IGraphics/Controls -I../../iPlug2/IGraphics/Platforms -I../../iPlug2/IGraphics/Extras -I../../iPlug2/Dependencies/IGraphics/NanoVG/src -I../../iPlug2/Dependencies/IGraphics/NanoSVG/src -I../../iPlug2/Dependencies/IGraphics/STB -I../../iPlug2/Dependencies/IGraphics/imgui -I../../iPlug2/Dependencies/IGraphics/imgui/backends -I../../iPlug2/Dependencies/IGraphics/yoga -I../../iPlug2/Dependencies/IGraphics/yoga/yoga -std=c++17 -Wno-bitwise-op-parentheses -DWDL_NO_DEFINE_MINMAX -DNDEBUG=1 -DWAM_API -DIPLUG_DSP=1 -DNO_IGRAPHICS -DSAMPLE_TYPE_FLOAT -O0 /workspaces/lmusic/TemplateProject/projects/../TemplateProject.cpp -c -o /tmp/emscripten_temp_3rkppmmg/TemplateProject_5.o' failed (1) make: *** [TemplateProject-wam-processor.mk:12: ../build-web/scripts/TemplateProject-wam.js] Error 1 emmake: error: 'make --makefile TemplateProject-wam-processor.mk' failed (2) IPlugWAM WASM compilation failed ```

Am I missing something? Is it supposed not to work?

Thanks.

olilarkin commented 3 years ago

This should fix it

https://github.com/iPlug2/iPlug2OOS/commit/d4ad14c1303be1285a25c34fa410e32e33003afc

You;ll need to add the IMidiSynth.cpp to the build like this

https://github.com/iPlug2/iPlug2/blob/master/Examples/IPlugInstrument/config/IPlugInstrument-web.mk#L8

gildurao commented 3 years ago

Yup, that fixed it, thank you!