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>
77 lines
2.2 KiB
Shell
Executable file
77 lines
2.2 KiB
Shell
Executable file
#!/bin/bash
|
|
# Build all KiCad dependencies for WebAssembly
|
|
# This script builds dependencies in the correct order
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/../common/env.sh"
|
|
source "${SCRIPT_DIR}/../common/functions.sh"
|
|
|
|
log_info "Building all KiCad dependencies for WASM..."
|
|
log_info "Using ${JOBS} parallel jobs"
|
|
|
|
# Parse arguments
|
|
CLEAN=""
|
|
WITH_OCC=0
|
|
WITH_NGSPICE=0
|
|
for arg in "$@"; do
|
|
case $arg in
|
|
--clean)
|
|
CLEAN="--clean"
|
|
;;
|
|
--with-occ)
|
|
WITH_OCC=1
|
|
;;
|
|
--with-ngspice)
|
|
WITH_NGSPICE=1
|
|
;;
|
|
--all)
|
|
WITH_OCC=1
|
|
WITH_NGSPICE=1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Build dependencies in order
|
|
|
|
# 1. Header-only libraries (no dependencies)
|
|
log_info "=== Phase 1: Header-only libraries ==="
|
|
"${SCRIPT_DIR}/build-glm.sh" ${CLEAN}
|
|
|
|
# 2. Basic libraries (minimal dependencies)
|
|
log_info "=== Phase 2: Basic compression/serialization ==="
|
|
"${SCRIPT_DIR}/build-zstd.sh" ${CLEAN}
|
|
"${SCRIPT_DIR}/build-protobuf.sh" ${CLEAN}
|
|
"${SCRIPT_DIR}/build-boost.sh" ${CLEAN}
|
|
|
|
# 3. Font rendering stack
|
|
log_info "=== Phase 3: Font rendering ==="
|
|
"${SCRIPT_DIR}/build-freetype.sh" ${CLEAN}
|
|
"${SCRIPT_DIR}/build-harfbuzz.sh" ${CLEAN}
|
|
|
|
# 4. Graphics stack (optional, for Cairo rendering)
|
|
log_info "=== Phase 4: Graphics libraries ==="
|
|
"${SCRIPT_DIR}/build-pixman.sh" ${CLEAN}
|
|
"${SCRIPT_DIR}/build-cairo.sh" ${CLEAN}
|
|
|
|
# 4b. Stub headers (needed for KiCad compilation but functionality is stubbed)
|
|
log_info "=== Phase 4b: Stub dependencies (headers only) ==="
|
|
"${SCRIPT_DIR}/build-curl-headers.sh" ${CLEAN}
|
|
"${SCRIPT_DIR}/build-libgit2-headers.sh" ${CLEAN}
|
|
|
|
# 5. Optional heavy dependencies
|
|
if [ $WITH_OCC -eq 1 ]; then
|
|
log_info "=== Phase 5a: OpenCASCADE (3D/STEP support) ==="
|
|
"${SCRIPT_DIR}/build-opencascade.sh" ${CLEAN}
|
|
fi
|
|
|
|
if [ $WITH_NGSPICE -eq 1 ]; then
|
|
log_info "=== Phase 5b: ngspice (SPICE simulation) ==="
|
|
"${SCRIPT_DIR}/build-ngspice.sh" ${CLEAN}
|
|
fi
|
|
|
|
log_info "============================================"
|
|
log_info "All dependencies built successfully!"
|
|
log_info "Install prefix: ${SYSROOT}"
|
|
log_info "============================================"
|