Skip to content

Commit 8b7f131

Browse files
author
amalxloop
committed
Fix WASM duplicate symbols and ranlib conflict
- Remove _IMPLEMENTATION macros from silvercore_wasm target_compile_definitions (sc_kernel.c defines them internally; target-level forces them on stock_dashboard.c too, causing duplicate symbols) - Add -DSC_SHARED=OFF to WASM CI cmake invocation (Emscripten can't build shared libs; SC_SHARED=ON produced libsc_kernel.a conflicting with static lib target)
1 parent 0041916 commit 8b7f131

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
version: 3.1.64
6060
- name: Build WASM target
6161
run: |
62-
emcmake cmake -S . -B build-wasm -DWASM=ON -DSC_TESTS=OFF
62+
emcmake cmake -S . -B build-wasm -DWASM=ON -DSC_TESTS=OFF -DSC_SHARED=OFF
6363
cmake --build build-wasm -j$(nproc)
6464
- name: Verify WASM output
6565
run: |

tools/wasm/CMakeLists.wasm.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,11 @@ add_executable(silvercore_wasm
8181
${CMAKE_SOURCE_DIR}/apps/stock_dashboard/stock_dashboard.c
8282
)
8383

84+
# Note: _IMPLEMENTATION macros are NOT defined here because both source
85+
# files already define them (sc_kernel.c unconditionally, stock_dashboard.c
86+
# when SC_NO_IMPLEMENTATION is absent). Defining them at target level would
87+
# force duplicate symbol definitions at link time.
8488
target_compile_definitions(silvercore_wasm PRIVATE
85-
SC_GFX_IMPLEMENTATION
86-
SC_LAYOUT_IMPLEMENTATION
87-
SC_WIDGET_IMPLEMENTATION
88-
SC_RUNTIME_IMPLEMENTATION
89-
SC_FONT_IMPLEMENTATION
9089
SC_GFX_BACKEND_SOFTWARE # WebGPU path TBD
9190
SC_PLATFORM_WASM
9291
)

0 commit comments

Comments
 (0)