Commit graph pcbjam/wasm
Author SHA1 Message Date
Viktor Vaczi
582b282a6c Add missing GLU_TESS_BOUNDARY_ONLY constant for idftools
The idftools/vrml_layer.cpp uses this GLU tessellation constant
which was missing from our WASM GLU stub header.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 11:24:24 +01:00
Viktor Vaczi
cb58b43bd1 Enable OpenGL GAL and 3D viewer stubs for WASM
Changes:
- Add glu_wasm_impl.cpp: GLU tesselator using KiCad's earcut triangulation
- Add GL/glu.h: GLU header for WASM builds
- Add 3D viewer stubs for KICAD_BUILD_3D_VIEWER_WASM=ON
- Remove obsolete gl_canvas_stub.cpp (OpenGL now uses real impl)
- Remove obsolete glu_stub.c (replaced by glu_wasm_impl.cpp)
- Update build-pcbnew.sh comment about GLU implementation

The OpenGL GAL now works in WASM using WebGL with LEGACY_GL_EMULATION.
3D viewer is stubbed out but builds successfully.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 08:19:40 +01:00
Viktor Vaczi
a26b40c063 Reorganize project structure for clarity
- Rename tests/wasm-app/ to tests/apps/ for brevity
- Move lib/gl_immediate_shim.js to wasm/shims/ (consolidates WASM files)
- Delete docs/ directory (outdated Nov 2024 research docs)
- Delete patches/ directory (already applied to fork submodules)
- Delete wasm/patches/ and wasm/config/ (empty/unused)
- Update all file references in scripts, configs, and documentation
- Update .gitignore for new tests/apps/ paths

Verified both build workflows pass:
- wxWidgets tests: 255 passed
- Docker KiCad build: completed successfully

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:06:23 +01:00
Viktor Vaczi
9c271996c2 Fix KiCad WASM build and runtime errors
Build improvements:
- Change -O0 to -O1 to fix "local count too large" asyncify error
- Add wasm-emscripten-finalize to host (Docker OOMs on large WASM)
- Use -gseparate-dwarf for smaller main binary with debug info
- Build native protoc for code generation
- Add more functions to asyncify removelist

Runtime fixes:
- Add inject-dyncall-shims.sh to fix "dynCall_* is not defined" in Emscripten 4.x
- Update wxwidgets with browserInfo.name fix

New stubs and bindings:
- Add Embind bindings for JavaScript interop
- Add stubs for scripting, API plugin, PCB frame, navlib

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 16:30:53 +01:00
Viktor Vaczi
898e079ef2 Enable 3D viewer in KiCad WASM build
Build the 3D viewer code for WASM instead of stubbing it out.
This is simpler to maintain than complex header stubs.

Changes:
- Enable KICAD_BUILD_3D_VIEWER_WASM=ON in build script
- Remove -gsource-map to avoid OOM in wasm-emscripten-finalize
- Add OpenGL stubs for fixed-function pipeline (WebGL ES 2.0 only)
- Add GLU stub for gluErrorString
- Add NNG stub for IPC API (sockets don't work in WASM)
- Add PCBnew scripting stub
- Expand curl and libgit2 stubs

The 3D viewer code compiles but won't render at runtime since
OpenGL GAL is disabled and Cairo GAL is used instead.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:21:29 +01:00
Viktor Vaczi
6771e7de74 Fix Asyncify and improve build process
Build system improvements:
- Add wasm-opt stub for Docker build to bypass asyncify in container
- Add apply-asyncify.sh script for host-side asyncify transformation
- Update build-pcbnew.sh to install wasm-opt stub and add EXPORTED_RUNTIME_METHODS
- Add --with-zlib=sys to wxWidgets configure for proper zlib linking
- Improve update-baseline-screenshots.sh to only copy new/significantly changed files

wxWidgets submodule update:
- Fix EM_JS to EM_ASYNC_JS for proper Asyncify registration

Test updates:
- Add new baseline screenshots for bitmapbuttons, dnd, gridrenderers, printpreview, specialized tests
- Add kicad-pcbnew initial screenshot
- Fix wxgrid-controls.png and wxgrid-dedicated-page.png (were showing errors)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 11:59:50 +01:00
Viktor Vaczi
9f4ed1e51e Add KiCad PCBnew WASM build support and documentation
Build infrastructure:
- Update build-pcbnew.sh with stub library compilation
- Update build-wxuniversal-wasm.sh with library symlinks and stubs
- Add stub libraries for libgit2 and curl (network ops via JS)
- Add WASM-specific CMake Find modules

Documentation:
- Add KICAD_WASM_BUILD.md with complete modification list
- Document 68 KiCad files modified for WASM support
- Document disabled features and reasons
- Document stub libraries and wxWidgets changes

Submodule updates:
- kicad: Add WASM/Emscripten build support (wasm-port branch)
- wxwidgets: Add KiCad compatibility fixes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 18:26:57 +01:00
Viktor Vaczi
c408410c7d Add KiCad PCBnew build script and CMake Find modules
- Add scripts/kicad/build-pcbnew.sh with clean-by-default and --no-clean flag
- Remove old scripts/build-pcbnew-wasm.sh (moved to scripts/kicad/)
- Add Boost build script with Emscripten toolset for Boost.Locale
- Add header download scripts for CURL and libgit2 (stub libraries)
- Add CMake Find modules for cross-compilation compatibility:
  - FindGLM.cmake: Reads version from setup.hpp
  - FindZSTD.cmake: Explicit sysroot paths
  - FindCURL.cmake: Header-only stub
  - FindSPNAV.cmake: Disabled (3D mouse not needed in browser)
  - FindCairo.cmake: Finds our built Cairo
  - FindPixman.cmake: Finds our built Pixman
  - Findlibgit2.cmake: Header-only stub
- Fix OpenCASCADE build: correct extracted dir name, add CMake policy
- Fix Protobuf build: correct GitHub release tag format (v21.12 not v3.21.12)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 11:37:14 +01:00
Viktor Vaczi
3034d9d76f Add KiCad WASM build infrastructure and dependency scripts
- Add build environment setup (scripts/common/env.sh, versions.sh, functions.sh)
- Add dependency build scripts for Zstd, GLM, FreeType, HarfBuzz, Pixman, Cairo
- Add placeholder scripts for OpenCASCADE, ngspice, protobuf
- Add WASM compatibility layer (wasm/kiplatform/, wasm/libcontext/)
- Add CMake modules for KiCad WASM cross-compilation
- Add PCBnew test infrastructure (tests/kicad/)
- Add build plan documentation

Successfully tested builds: Zstd 1.5.5, GLM 0.9.9.8, FreeType 2.13.2,
HarfBuzz 8.3.0, Pixman 0.42.2, Cairo 1.18.0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 13:15:04 +01:00