-
-
Notifications
You must be signed in to change notification settings - Fork 9
Standardise dependency management with vcpkg #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…mscripten's README.md
…problems trying to load the module. There are also some changes here that I had previously made for 2.2.1.
With these changes I am able to build and load fluidsynth as an AudioWorklet processor.
From v2.2.1 also needed in v2.3.0
- Added some additional EXPORTS to CMakelists.txt to fix runtime unresolveds: addFunction,removeFunction,MEMFS,lengthBytesUTF8,UTF8ArrayToString,UTF8ToString,stringToUTF8Array,stringToUTF8.
Additional change for 2.3.0
Failed to Base64 decode the WASM binary b/c atob() didn't exist. Maybe it's not defined in the AudioWorklet scope? I put back a polyfill that was in the 2.2.1 code, added this to pre.js.
Build tools:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.43 (a6b8143cf3c1171db911750359456b15a8deece7)
clang version 17.0.0 (https://github.com/llvm/llvm-project 71513a71cdf380efd6a44be6939e2cb979a62407)
Target: wasm32-unknown-emscripten
Thread model: posix
Tested on Chrome Version 114.0.5735.133 (Official Build) (64-bit)
Significant possibility that this is user error on my part, but I was not able to find another solution.
Changes to load fluidsynth-emscriptem as an AudioWorklet processor
This reverts commit cd5f4dd.
|
Thanks for the PR. I successfully built libfluidsynth.js with libsndfile. mkdir build-with-sndfile # or any directory name
cd build-with-sndfile
# These two lines seem to be necessary for vcpkg to detect compilers correctly
export CC=emcc
export CXX=em++
cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=<path-to-emscripten>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -Denable-aufile=off -Denable-oss=off -Denable-libsndfile=on -DCMAKE_BUILD_TYPE=Release ..If you can, please write building instruction (with vcpkg) to README.md. |
| *.user | ||
|
|
||
| # Package manager | ||
| vcpkg_installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be unnecessary because vcpkg_installed is created in build directory by default.
(Executing build command on the root directory is not recommended.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My makefile is gitignored, whoops.
Why is executing build on root not recommended?
The build output will still be generated in the "build" folder.
For me I run - on macos:
1. Install dependency - in this case sndfile according to vcpkg.json
vcpkg install --triplet wasm32-emscripten
This creates a vcpkg_installed folder in project root.
2. Build file
emcmake cmake -B build/wasm-libsndfile --preset wasm-libsndfile
emmake make -C build/wasm-libsndfile
Here is a the makefile I used that is gitignored:
install:
vcpkg install --triplet wasm32-emscripten
wasm:
emcmake cmake -B build/wasm-vanilla --preset wasm
emmake make -C build/wasm-vanilla
wasm-libsndfile:
emcmake cmake -B build/wasm-libsndfile --preset wasm-libsndfile
emmake make -C build/wasm-libsndfile
clean:
rm -rf build
Preset options are written in CMakePresets.json
Then we can extend presets and add installation scripts to makefile for different configs.
Build instructions
make install
make wasm-libsndfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response.
The build directory is a recommendation based on the original FluidSynth building instruction (https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake).
I think it has an advantage that the all intermediate/output files will be generated into build directory.
Merging correct branch, initially #10.
Successfully building libsndfile for issue #9
The CMakeLists.txt is currently written to succeed despite not finding packages.
Ideally it should fail when a package is not found.
Why build for something if it lacks the feature we want?
VCPKG provides ".pc" files required by pkg_check_modules()
I've added CMakePresets.json to simplify build scripts in makefile.
Effect of changes:
BUILD_SHARED_LIBSfor wasm build.