diff --git a/docs/BUILDING.md b/docs/BUILDING.md index bb88682..f059bab 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -115,6 +115,32 @@ export CXXFLAGS="${CFLAGS}" # make etc.. ``` +## Web assembly + +Cardinal uses emscripten for its web version, see the official instructions on installing emscripten [here](https://emscripten.org/docs/getting_started/downloads.html). +Once installed, setup the build by importing the emscripten environment and setup the default build tools to point to them, like so: + +``` +source /path/to/emsdk/emsdk_env.sh +export AR=emar +export CC=emcc +export CXX=em++ +export NM=emnm +export RANLIB=emranlib +export STRIP=emstrip +``` + +Then for the actual build we just need to force graphics rendering to use GLES2 instead of the default "desktop" OpenGL mode, like so: + +``` +make USE_GLES2=true # add any other relevant options.. +``` + +You can place the generated files on a webserver, or run `emrun bin/CardinalNative.html` for an easy way to test it. + +Please note the web build only contains CardinalNative, no other variants will be built. +This is expected and intentional. + ## Windows Cardinal does not support msvc, using mingw is required. @@ -133,7 +159,7 @@ export CC=x86_64-w64-mingw32-gcc export CXX=x86_64-w64-mingw32-g++ export EXE_WRAPPER=wine # for running generated windows binaries export PKG_CONFIG=false # ignore pkg-config from base system -# now run make etc.. +# make etc.. ``` # Installing diff --git a/dpf b/dpf index e840509..924576a 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit e8405098f40d0730ef4cdb4bb743897f6e7472ac +Subproject commit 924576a58c3f3a98d7df56f189f3f53fc4da0abb diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index 84300bd..292a0aa 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -156,7 +156,7 @@ endif # -------------------------------------------------------------- # FIXME -ifeq ($(WASM),true) +ifeq ($(CIBUILD)$(WASM),truetrue) ifneq ($(STATIC_BUILD),true) STATIC_CARLA_PLUGIN_LIBS = -lsndfile -lopus -lFLAC -lvorbisenc -lvorbis -logg -lm endif