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>
73 lines
2 KiB
C++
73 lines
2 KiB
C++
/*
|
|
* PCB Frame stubs for KiCad WASM build
|
|
* Python action plugins are not available in WASM
|
|
*
|
|
* These stubs provide implementations for methods that are declared in headers
|
|
* but whose implementations depend on scripting features not available in WASM.
|
|
*/
|
|
|
|
#include <pcb_edit_frame.h>
|
|
#include <pcb_base_frame.h>
|
|
#include <footprint.h>
|
|
#include <action_plugin.h>
|
|
#include <board.h>
|
|
|
|
class ACTION_MENU;
|
|
|
|
// PCB_EDIT_FRAME static method implementations
|
|
// These are called from panel_pcbnew_action_plugins.cpp
|
|
|
|
std::vector<LEGACY_OR_API_PLUGIN> PCB_EDIT_FRAME::GetOrderedActionPlugins()
|
|
{
|
|
// Return empty list: no plugins available in WASM
|
|
return {};
|
|
}
|
|
|
|
bool PCB_EDIT_FRAME::GetActionPluginButtonVisible( const wxString& aPluginPath, bool aPluginDefault )
|
|
{
|
|
(void)aPluginPath;
|
|
// Return the default value since we can't check settings for non-existent plugins
|
|
return aPluginDefault;
|
|
}
|
|
|
|
void PCB_EDIT_FRAME::buildActionPluginMenus( ACTION_MENU* aActionMenu )
|
|
{
|
|
(void)aActionMenu;
|
|
// No-op: action plugins not available in WASM
|
|
}
|
|
|
|
// PCB_BASE_FRAME protected method implementation
|
|
// The declaration is NOT guarded by wxUSE_FSWATCHER but the implementation IS,
|
|
// so we need a stub when filesystem watcher is not available.
|
|
#if !wxUSE_FSWATCHER
|
|
void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
|
|
{
|
|
(void)aFootprint;
|
|
// No-op: filesystem watcher not available in WASM
|
|
}
|
|
#endif
|
|
|
|
// Scripting helper functions stub
|
|
// These are in pcbnew_scripting_helpers.cpp which is only compiled with KICAD_SCRIPTING
|
|
BOARD* LoadBoard( const wxString& aFileName, bool aSetActive )
|
|
{
|
|
(void)aFileName;
|
|
(void)aSetActive;
|
|
// Scripting not available in WASM
|
|
return nullptr;
|
|
}
|
|
|
|
bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings )
|
|
{
|
|
(void)aFileName;
|
|
(void)aBoard;
|
|
(void)aSkipSettings;
|
|
// Scripting not available in WASM
|
|
return false;
|
|
}
|
|
|
|
BOARD* CreateEmptyBoard()
|
|
{
|
|
// Scripting not available in WASM
|
|
return nullptr;
|
|
}
|