Skip to content

Commit

Permalink
GitHub Actions: Enabled Release build on MacOS and disabled on anothe…
Browse files Browse the repository at this point in the history
…r platfroms
  • Loading branch information
MikhailGorobets committed Jul 16, 2024
1 parent 63a8d29 commit 36a446d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,39 @@ jobs:
matrix:
os: ["windows-latest", "ubuntu-20.04", "macos-14"]
build_type: ["Debug", "Release"]
exclude:
# Exclude MacOS-Release
- os: "macos-14"
build_type: "Release"

include:
- os: "windows-latest"
build_type: "Release"
host_name: "Win10"
# Do not build WebGPU on Windows/Release as it is extremely slow
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON -DDILIGENT_NO_WEBGPU=ON"
cmake_args: "-DDILIGENT_NO_WEBGPU=ON -DDILIGENT_NO_ARCHIVER=ON -DDILIGENT_EMSCRIPTEN_DISABLE_LTO=ON"

- os: "windows-latest"
build_type: "Debug"
host_name: "Win10"
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"

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

- os: "ubuntu-20.04"
build_type: "Release"
host_name: "Linux"
# Do not build WebGPU on Linux/Release as it is extremely slow
cmake_args: "-DDILIGENT_NO_WEBGPU=ON -DDILIGENT_NO_ARCHIVER=ON -DDILIGENT_EMSCRIPTEN_DISABLE_LTO=ON"

- os: "macos-14"
build_type: "Debug"
host_name: "MacOS"
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"

- os: "macos-14"
build_type: "Release"
host_name: "MacOS"
cmake_args: "-DDILIGENT_EMSCRIPTEN_DISABLE_LTO=ON"

runs-on: ${{ matrix.os }}
name: ${{ matrix.host_name }} -> Emscripten, ${{ matrix.build_type }}

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ endif()

option(DILIGENT_BUILD_SAMPLE_BASE_ONLY "Build only SampleBase project" OFF)
option(DILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO "Strip debug information from Emscripten build" OFF)
option(DILIGENT_EMSCRIPTEN_DISABLE_LTO "Disable lint time optiomizations for Emscripten build" OFF)

function(add_sample_app APP_NAME IDE_FOLDER SOURCE INCLUDE SHADERS ASSETS)

Expand Down
4 changes: 4 additions & 0 deletions SampleBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ elseif(PLATFORM_EMSCRIPTEN)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND DILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO)
target_link_options(${TARGET_NAME} PRIVATE "SHELL: -gseparate-dwarf -g0")
endif()

if(DILIGENT_EMSCRIPTEN_DISABLE_LTO)
target_link_options(${TARGET_NAME} PRIVATE "SHELL: -s ERROR_ON_WASM_CHANGES_AFTER_LINK")
endif()
endfunction()

else()
Expand Down

0 comments on commit 36a446d

Please sign in to comment.