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 b28ed1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ jobs:
include:
- os: "windows-latest"
host_name: "Win10"
cmake_args: "-DDILIGENT_BUILD_CORE_TESTS=ON -DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"

- os: "ubuntu-20.04"
host_name: "Linux"
cmake_args: "-DDILIGENT_BUILD_CORE_TESTS=ON -DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"

- os: "macos-14"
host_name: "MacOS"
cmake_args: "-DDILIGENT_BUILD_CORE_TESTS=ON -DDILIGENT_BUILD_CORE_INCLUDE_TEST=ON"

runs-on: ${{ matrix.os }}
name: ${{ matrix.host_name }} -> Emscripten, ${{ matrix.build_type }}
Expand All @@ -44,7 +47,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: ${{ matrix.cmake_args }}

- name: Build
if: success()
Expand Down
7 changes: 7 additions & 0 deletions BuildTools/CMake/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ function(set_common_target_properties TARGET)
endif()
endif() # if(MSVC)

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

if(COMMAND custom_post_configure_target)
custom_post_configure_target(${TARGET})
endif()
Expand Down

0 comments on commit b28ed1e

Please sign in to comment.