Skip to content

Commit c5fb389

Browse files
committed
CraterCrashGH-609 Add Web Assembly (wasm32) support
1 parent 3307fd1 commit c5fb389

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.github/actions/web-deps/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Setup Web Dependencies
2+
description: Setup Web Build Dependencies
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Install Emscripten
8+
uses: mymindstorm/setup-emsdk@v14
9+
with:
10+
version: 3.1.39
11+
actions-cache-folder: "emsdk-cache"

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
platform: armeabi-v7a
5353
arch: armeabi-v7a
5454

55+
- identifier: wasm32
56+
name: 🌐 Web (wasm32)
57+
build_type: Release
58+
runner: ubuntu-20.04
59+
platform: web
60+
5561
runs-on: ${{ matrix.runner }}
5662
name: ${{ matrix.name }}
5763

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

87+
- name: Setup Web Dependencies
88+
if: startsWith(matrix.identifier, 'wasm')
89+
uses: ./.github/actions/web-deps
90+
8191
- name: Setup Base Dependencies
8292
uses: ./.github/actions/base-deps
8393

CMakePresets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@
8181
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
8282
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
8383
}
84+
},
85+
{
86+
"name": "web",
87+
"cacheVariables": {
88+
"CMAKE_BUILD_TYPE": "Release",
89+
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
90+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
91+
"CMAKE_C_COMPILER": "emcc",
92+
"CMAKE_CXX_COMPILER": "em++",
93+
"CMAKE_TOOLCHAIN_FILE": "$env{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
94+
}
8495
}
8596
]
8697
}

project/addons/orchestrator/orchestrator.gdextension

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ android.arm32 = "res://addons/orchestrator/liborchestrator.android.32.release.so
2020

2121
android.arm64 = "res://addons/orchestrator/liborchestrator.android.64.release.so"
2222
#android.debug.arm64 = "res://addons/orchestrator/liborchestrator.android.64.debug.so"
23+
24+
web.wasm32 = "res://addons/orchestrator/orchestrator.emscripten.32.release.a"

0 commit comments

Comments
 (0)