pcbjam/wasm/stubs/scripting_stub.cpp
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

65 lines
1.3 KiB
C++

/*
* Scripting stubs for KiCad WASM build
* Python scripting is not available in WASM
*
* These stubs provide implementations for methods declared in pcb_scripting_tool.h
* that are called from panel_pcbnew_action_plugins.cpp
*/
#include <python/scripting/pcb_scripting_tool.h>
// Constructor/Destructor implementations
SCRIPTING_TOOL::SCRIPTING_TOOL() :
PCB_TOOL_BASE( "pcbnew.ScriptingTool" )
{
}
SCRIPTING_TOOL::~SCRIPTING_TOOL()
{
}
// Virtual method implementations
bool SCRIPTING_TOOL::Init()
{
return true;
}
void SCRIPTING_TOOL::Reset( RESET_REASON aReason )
{
(void)aReason;
}
// Static method implementations - these are called from panel_pcbnew_action_plugins.cpp
void SCRIPTING_TOOL::ReloadPlugins()
{
// No-op: Python plugins not available in WASM
}
void SCRIPTING_TOOL::ShowPluginFolder()
{
// No-op: Plugin folder not accessible in WASM
}
// Private method implementations
int SCRIPTING_TOOL::reloadPlugins( const TOOL_EVENT& aEvent )
{
(void)aEvent;
return 0;
}
int SCRIPTING_TOOL::showPluginFolder( const TOOL_EVENT& aEvent )
{
(void)aEvent;
return 0;
}
void SCRIPTING_TOOL::setTransitions()
{
// No transitions: scripting not available
}
// Private static method - must be provided since it's declared in header
void SCRIPTING_TOOL::callLoadPlugins()
{
// No-op: Python not available in WASM
}