pcbjam/wasm/cmake/Findngspice.cmake
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

25 lines
882 B
CMake

# Findngspice.cmake - Stub for WASM builds
# ngspice is not available in WASM builds (KICAD_SPICE=OFF)
# We provide stub values so CMake configuration succeeds
if(EMSCRIPTEN OR NOT KICAD_SPICE)
message(STATUS "ngspice not available for WASM build (SPICE disabled)")
# Set variables to indicate ngspice is "found" but disabled
set(ngspice_FOUND TRUE)
set(NGSPICE_FOUND TRUE)
# Provide empty values
set(NGSPICE_INCLUDE_DIR "")
set(NGSPICE_LIBRARY "")
set(NGSPICE_LIBRARIES "")
mark_as_advanced(NGSPICE_INCLUDE_DIR NGSPICE_LIBRARY)
else()
# For non-WASM builds, use the system findngspice
find_path(NGSPICE_INCLUDE_DIR ngspice/sharedspice.h)
find_library(NGSPICE_LIBRARY NAMES ngspice)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ngspice DEFAULT_MSG NGSPICE_LIBRARY NGSPICE_INCLUDE_DIR)
endif()