fix(wasm): add MODEL_SUBSTITUTION no-op stub for 3D-disabled pcbnew/footprint build

Provides wasm/stubs/model_substitution_stub.cpp — no-op IsWrlExtension /
STEP_CATALOG::Build / FindMatchFor — so pcbnew and footprint_editor link when the
3D viewer is off (KICAD_BUILD_3D_VIEWER_WASM=OFF). The KiCad 10 rebase made
dialog_migrate_3d_models.cpp reference these, which live in the unlinked 3D
library. The browser build has no 3D viewer, so model migration finds no
substitutions. Bumps kicad to the matching CMake wiring (fef0343).

Verified: pcbnew + footprint_editor compile and link clean (eeschema/symbol_editor
unaffected).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gergő Törcsvári 2026-06-26 08:14:47 +02:00
commit d6ce380458
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
2 changed files with 38 additions and 1 deletions

2
kicad

@ -1 +1 @@
Subproject commit c63009046c06011a0220b0e3ada28e084ffe4e54
Subproject commit fef0343a97c0c8426128422924fbd5e065cbd1f3

View file

@ -0,0 +1,37 @@
/*
* MODEL_SUBSTITUTION stubs for the KiCad WASM build.
*
* When KICAD_BUILD_3D_VIEWER_WASM=OFF the 3D-viewer library is not linked, but
* it is where the .wrlSTEP model-substitution helpers
* (3d-viewer/3d_cache/model_substitution_helpers.cpp) live. pcbnew's
* dialog_migrate_3d_models.cpp still references them, so the final pcbnew/
* footprint_editor link fails with undefined MODEL_SUBSTITUTION symbols.
*
* These no-op stubs satisfy the linker. There is no 3D viewer in the browser
* build, so model migration simply finds no substitutions (the dialog reports
* nothing to migrate) which is the correct behavior for a WASM build with no
* local 3D model filesystem.
*/
#include <3d_cache/model_substitution_helpers.h>
namespace MODEL_SUBSTITUTION
{
bool IsWrlExtension( const wxString& )
{
return false;
}
void STEP_CATALOG::Build( const wxString&, const FILENAME_RESOLVER* )
{
}
wxString STEP_CATALOG::FindMatchFor( const wxString& ) const
{
return wxEmptyString;
}
} // namespace MODEL_SUBSTITUTION