pcbjam/core/include/config.h
Viktor Vaczi 92faf7c082 Add standalone core library with kimath and sexpr (Phase 2 Step 1)
Create standalone build system for KiCad's core computation libraries
that compiles without wxWidgets, targeting both native and WebAssembly.

Key additions:
- wx_shim.h: ~250 lines replacing wx utilities with standard C++
  - wxString class with Format() method
  - wxFFile for file I/O
  - wxASSERT, wxCHECK, wxFAIL_MSG macros
  - wxLog stubs
- Stub headers: wx/debug.h, wx/log.h, wx/string.h, wx/file.h, etc.
- config.h, advanced_config.h: Platform and triangulation config
- CMakeLists.txt: Builds kimath, sexpr, clipper2, rtree

Build results:
- Native: libkimath.a (1.4MB), libsexpr.a, test passes
- WASM: test_kimath.wasm (867KB), runs in Node.js

Test verifies:
- VECTOR2I, SEG, SHAPE_POLY_SET geometry operations
- S-expression parsing of .kicad_pcb format

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 17:39:53 +01:00

31 lines
783 B
C

/*
* config.h - Minimal config for kicad-core standalone build
*
* This replaces the auto-generated config.h from KiCad's CMake
*/
#ifndef KICAD_CORE_CONFIG_H
#define KICAD_CORE_CONFIG_H
// Platform detection for timing functions
#if defined(_WIN32)
// Windows uses GetSystemTimeAsFileTime
#elif defined(__APPLE__) || defined(__linux__) || defined(__unix__)
#define HAVE_CLOCK_GETTIME 1
#else
#define HAVE_GETTIMEOFDAY_FUNC 1
#endif
// Version info
#define KICAD_MAJOR_VERSION 8
#define KICAD_MINOR_VERSION 0
#define KICAD_PATCH_VERSION 0
#define KICAD_VERSION_FULL "8.0.0-wasm"
// Feature flags - all disabled for core-only build
#define KICAD_USE_CURL 0
#define KICAD_USE_GIT 0
#define KICAD_USE_OCC 0
#define KICAD_USE_NGSPICE 0
#endif // KICAD_CORE_CONFIG_H