diff --git a/.github/actions/web-deps/action.yml b/.github/actions/web-deps/action.yml new file mode 100644 index 00000000..06d941cd --- /dev/null +++ b/.github/actions/web-deps/action.yml @@ -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" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a681b8..087f2d1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} @@ -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 diff --git a/CMakePresets.json b/CMakePresets.json index db5624e6..26c3413d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -81,6 +81,18 @@ "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", + "CMAKE_CXX_FLAGS": "-s SIDE_MODULE=1" + } } ] } \ No newline at end of file diff --git a/project/addons/orchestrator/orchestrator.gdextension b/project/addons/orchestrator/orchestrator.gdextension index c5f82326..ad0f3946 100644 --- a/project/addons/orchestrator/orchestrator.gdextension +++ b/project/addons/orchestrator/orchestrator.gdextension @@ -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" \ No newline at end of file