pcbjam/wasm/libcontext/CMakeLists.txt
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

23 lines
571 B
CMake

# WASM implementation of libcontext using Emscripten Asyncify
# Provides fiber/coroutine support for KiCad's router
set(LIBCONTEXT_WASM_SRCS
libcontext_wasm.cpp
)
add_library(libcontext_wasm STATIC ${LIBCONTEXT_WASM_SRCS})
target_include_directories(libcontext_wasm PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
# Asyncify is required for fiber support
# These flags must also be set on the final executable
target_compile_options(libcontext_wasm PRIVATE
-pthread
)
target_link_options(libcontext_wasm INTERFACE
-sASYNCIFY=1
-sASYNCIFY_STACK_SIZE=65536
)