From 1a591264ca404605d31fb6614c205885d7c16ed8 Mon Sep 17 00:00:00 2001 From: assiduous Date: Fri, 31 Jan 2025 20:24:53 -0800 Subject: [PATCH] GitHub Actions/Emscripten: strip debug information to fix the toolchain crash --- .github/workflows/build-emscripten.yml | 2 +- Tests/DiligentCoreAPITest/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index 286d40f63..85d643e63 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -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() diff --git a/Tests/DiligentCoreAPITest/CMakeLists.txt b/Tests/DiligentCoreAPITest/CMakeLists.txt index 397fde3c7..87debd3ba 100644 --- a/Tests/DiligentCoreAPITest/CMakeLists.txt +++ b/Tests/DiligentCoreAPITest/CMakeLists.txt @@ -95,6 +95,10 @@ if (PLATFORM_EMSCRIPTEN) set(HTML_TEMPLATE_FILE ${PROJECT_SOURCE_DIR}/resources/emscripten_template.html) target_link_options(DiligentCoreAPITest PRIVATE "SHELL: -s SINGLE_FILE -s ALLOW_MEMORY_GROWTH=1 --preload-file '${RESOURCE_PATH}@'") target_link_options(DiligentCoreAPITest PRIVATE "SHELL: --shell-file '${HTML_TEMPLATE_FILE}'") + target_link_options(DiligentCoreAPITest PRIVATE "SHELL: -s WASM_BIGINT -s WASM=1") + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND DILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO) + target_link_options(${TARGET_NAME} PRIVATE "SHELL: -gseparate-dwarf -g0") + endif() endif() target_link_libraries(DiligentCoreAPITest