fluidsynth-emscripten
fluidsynth-emscripten copied to clipboard
static lib
is there easy way to compile this to static lib for larger c++ projects ?
the current version no longer compiles anymore either for some reason. maybe from new emsdk
@netpipe See this page for library builds, based on this branch.
I think for static, you can pass emcc -I[path_to_fluidsynth_headers] -L[path_to_fluidsynth.a], but I have not tested it. I also built shared libraries, which you can use per these instructions.
[ 2%] Building C object src/CMakeFiles/libfluidsynth-OBJ.dir/drivers/fluid_aufile.c.o /home/netpipe/Downloads/fluidsynth-emscripten-2.0.2-em-maz/src/drivers/fluid_aufile.c:27:10: error: 'fluid_sys.h' file not found [clang-diagnostic-error] #include "fluid_sys.h"
i tried setting the /build/ make -I../include with same errors
also when using as drop in replacement i get a few undefined symbols, delete_fluid_cmd_handler , fluid_get_sysconf, fluid_get_userconf , fluid_source , new_fluid_cmd_handler , new_fluid_server
here are some examples select emscripten from build options to compile. they compile but get no sound.
Sorry for the late response.
I did not try to build as a static library because of LGPL, so I don't have any idea now.
But it is welcome to do it, including creating PR.
FYI: I rebased the master branch to follow newer FluidSynth source code, so please be careful when pulling.
I don't have any idea now.
I found the idea for building the static library, and I pushed 4c1e007. Please pull the branch and try following commands:
mkdir build
cd build
emcmake cmake -D BUILD_SHARED_LIBS=off ..
make -j16
I can confirm that emcmake cmake -D BUILD_SHARED_LIBS=off .. just works. This is how I use fluidsynth for emscripten on my toy project at https://github.com/s-d-m/lilyplayer/blob/dba2dfd5484c71b5de49a96e9a18e2d8776f5c1c/Makefile.wasm#L100
https://github.com/netpipe/FluidLite/blob/master/example/ i have this now too , different sound playing frontends