openslide-winbuild
openslide-winbuild copied to clipboard
Emscripten build
From https://github.com/openslide/openslide/pull/621
For building, you will need to have emscripten and wasm-ld installed
Meson setup command
meson setup builddir --cross-file machines/cross-emscripten.ini --default-library=static -Dzlib:default_library=static -Dlibffi:default_library=static -Dlibxml2:default_library=static -Dsqlite3:default_library=static -Dzstd:default_library=static -Dlibpng:default_library=static -Dlibopenjp2:default_library=static -Dglib:default_library=static -Dgdk-pixbuf:default_library=static -Dpixman:default_library=static -Dcairo:default_library=static -Duthash:default_library=static -Dlibdico:default_library=static -Dopenslide:default_library=static -Dproxy-libintl:default_library=static
meson compile -C builddir
I have changed glib.wrap because building glib with emscripten needs particular changes (https://github.com/emscripten-core/emscripten/issues/11066) but it stills fails building.
It currently stuck to glib/gdk-pixbuf compilation part
When trying to compile pcre2 it says
pcre2| Checking for function "mkostemp" : YES
subprojects/pcre2-10.44/meson.build:73:6: ERROR: Problem encountered: Your configuration is not supported
but pcre2 wasm build are present online https://github.com/stephen-riley/pcre2-wasm/blob/master/Makefile, so it is possible but I don't know for now how to do it. (Pcre2 was needed for glib 2.80.3 (previous version of glib.wrap that I modified))
So, for a successful wasm32 build, I think a correct emscripten patch for glib would do the trick.