Enable exceptions and pthreads atomics for KiCad WASM build

Build fixes:
- Enable C++ exceptions in wxWidgets (--enable-exceptions, -fexceptions)
  Required for KiCad's OnExceptionInMainLoop override in debug builds
- Add -matomics -mbulk-memory to all dependency builds for shared memory
  Required for pthreads support with Emscripten
- Fix docker/build.sh output copy path (pcbnew/ not bin/)
- Make workspace mount read-only in docker-compose.yml

Updated dependency scripts:
- build-freetype.sh, build-harfbuzz.sh, build-protobuf.sh
- build-zstd.sh, build-opencascade.sh, build-boost.sh
- build-pixman.sh, build-cairo.sh (meson cross-file)
- build-wxuniversal-wasm.sh, build-pcbnew.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2025-12-13 11:29:45 +01:00
commit d8d934ffca
13 changed files with 100 additions and 34 deletions

View file

@ -59,7 +59,7 @@ cd "$BUILD_DIR"
# --enable-universal Use wxUniversal (draws widgets directly)
# --disable-shared Build static libraries
# --with-opengl Enable OpenGL/WebGL support
# --disable-exceptions Emscripten doesn't support C++ exceptions well
# --enable-exceptions Enable C++ exceptions (needed for KiCad debug builds)
# --disable-richtext Not needed for KiCad, simplifies build
# --without-libtiff Avoid external dependencies
# --disable-xlocale Browser environment handles locale
@ -83,8 +83,8 @@ else
echo "Building wxWidgets in RELEASE mode"
fi
export CFLAGS="-DZ_HAVE_UNISTD_H=1 ${WX_DEBUG_FLAGS}"
export CXXFLAGS="-DZ_HAVE_UNISTD_H=1 -I$PCRE2_INCLUDE ${WX_DEBUG_FLAGS}"
export CFLAGS="-DZ_HAVE_UNISTD_H=1 ${WX_DEBUG_FLAGS} -fexceptions -pthread -matomics -mbulk-memory"
export CXXFLAGS="-DZ_HAVE_UNISTD_H=1 -I$PCRE2_INCLUDE ${WX_DEBUG_FLAGS} -fexceptions -pthread -matomics -mbulk-memory"
emconfigure "$WX_SOURCE/configure" \
--host=emscripten \
@ -92,7 +92,7 @@ emconfigure "$WX_SOURCE/configure" \
--enable-universal \
--disable-shared \
--with-opengl \
--disable-exceptions \
--enable-exceptions \
--disable-richtext \
--without-libtiff \
--disable-xlocale \