fluidsynth-emscripten icon indicating copy to clipboard operation
fluidsynth-emscripten copied to clipboard

static lib

Open netpipe opened this issue 5 years ago • 9 comments

is there easy way to compile this to static lib for larger c++ projects ?

netpipe avatar Dec 09 '19 23:12 netpipe

the current version no longer compiles anymore either for some reason. maybe from new emsdk

netpipe avatar May 18 '20 02:05 netpipe

@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.

mazmazz avatar Jun 12 '20 13:06 mazmazz

build.txt

[ 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

netpipe avatar Jun 12 '20 21:06 netpipe

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

netpipe avatar Jun 12 '20 22:06 netpipe

test.zip

here are some examples select emscripten from build options to compile. they compile but get no sound.

netpipe avatar Jun 12 '20 22:06 netpipe

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.

jet2jet avatar Jun 14 '20 06:06 jet2jet

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

jet2jet avatar Apr 10 '21 09:04 jet2jet

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

s-d-m avatar Jun 21 '22 21:06 s-d-m

https://github.com/netpipe/FluidLite/blob/master/example/ i have this now too , different sound playing frontends

netpipe avatar Jun 21 '22 21:06 netpipe