Skip to content

Commit

Permalink
GitHub Actions/Emscripten: strip debug information to fix the toolcha…
Browse files Browse the repository at this point in the history
…in crash
  • Loading branch information
TheMostDiligent committed Feb 1, 2025
1 parent a5a85e4 commit 76cf369
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: DiligentGraphics/github-action/configure-cmake@v1
with:
build-type: ${{ matrix.build_type }}
cmake-args: "-DDILIGENT_BUILD_CORE_INCLUDE_TEST=ON -DDILIGENT_BUILD_CORE_TESTS=ON"
cmake-args: "-DDILIGENT_BUILD_CORE_INCLUDE_TEST=ON -DDILIGENT_BUILD_CORE_TESTS=ON -DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"

- name: Build
if: success()
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,17 @@ if (PLATFORM_EMSCRIPTEN)
"-pthread"
"-mbulk-memory"
)

# WebAssembly integration with JavaScript BigInt: wasm VM will use a BigInt where an i64 is used
target_link_options(Diligent-BuildSettings INTERFACE "SHELL: -s WASM_BIGINT")

# Compile code to WebAssembly (0 - JavaScript, 2 - WebAsm + JS)
target_link_options(Diligent-BuildSettings INTERFACE "SHELL: -s WASM=1")

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND DILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO)
# Strip debug info from WebAssembly binary. Without this option, the toolchain crashes on CI.
target_link_options(Diligent-BuildSettings INTERFACE "SHELL: -gseparate-dwarf -g0")
endif()
endif()

target_link_libraries(Diligent-BuildSettings INTERFACE Diligent-PublicBuildSettings)
Expand Down

0 comments on commit 76cf369

Please sign in to comment.