Skip to content

Commit

Permalink
CraterCrashGH-609 Add Web Assembly (wasm32) support
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 24, 2024
1 parent 7bbc5a1 commit 58fd9f8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/web-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Setup Web Dependencies
description: Setup Web Build Dependencies
runs:
using: "composite"
steps:

- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.39
actions-cache-folder: "emsdk-cache"
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
platform: armeabi-v7a
arch: armeabi-v7a

- identifier: wasm32
name: 🌐 Web (wasm32)
build_type: Release
runner: ubuntu-20.04
platform: web

runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}

Expand All @@ -78,6 +84,10 @@ jobs:
if: startsWith(matrix.identifier, 'android-')
uses: ./.github/actions/android-deps

- name: Setup Web Dependencies
if: startsWith(matrix.identifier, 'wasm')
uses: ./.github/actions/web-deps

- name: Setup Base Dependencies
uses: ./.github/actions/base-deps

Expand Down
11 changes: 11 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
}
},
{
"name": "web",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CMAKE_C_COMPILER": "emcc",
"CMAKE_CXX_COMPILER": "em++",
"CMAKE_TOOLCHAIN_FILE": "$env{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
}
}
]
}
2 changes: 2 additions & 0 deletions project/addons/orchestrator/orchestrator.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ android.arm32 = "res://addons/orchestrator/liborchestrator.android.32.release.so

android.arm64 = "res://addons/orchestrator/liborchestrator.android.64.release.so"
#android.debug.arm64 = "res://addons/orchestrator/liborchestrator.android.64.debug.so"

web.wasm32 = "res://addons/orchestrator/orchestrator.emscripten.32.release.a"

0 comments on commit 58fd9f8

Please sign in to comment.