From e41c76bd75364c8fc79cd8264c1c9ea205f8950b Mon Sep 17 00:00:00 2001 From: Troy Schrapel Date: Wed, 6 Sep 2023 09:11:59 +0930 Subject: [PATCH] Updated emconfig.bat to setup the build directory using emcmake --- .github/workflows/emulator-wasm.yml | 7 +------ emconfig.bat | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/emulator-wasm.yml b/.github/workflows/emulator-wasm.yml index bf388d7..12e74e6 100644 --- a/.github/workflows/emulator-wasm.yml +++ b/.github/workflows/emulator-wasm.yml @@ -24,12 +24,7 @@ jobs: - name: Setup emscripten working-directory: ${{ github.workspace }} - run: ./emconfig.bat - - - name: Configure CMake - working-directory: ${{ github.workspace }} - run: > - emcmake cmake -B ${{ env.OUTPUT_DIR }} -S ${{ github.workspace }} + run: ./emconfig.bat ${{ env.OUTPUT_DIR }} - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). diff --git a/emconfig.bat b/emconfig.bat index ad6528a..03bf100 100644 --- a/emconfig.bat +++ b/emconfig.bat @@ -1,6 +1,27 @@ +:: Setup WebAssembly build +:: Takes a single argument bing the build directory (default: build_wasm) +:: +:: Usage: +:: ./emconfig.bat +:: +:: Example: +:: ./emconfig.bat build_wasm + + +@echo off +setlocal +set BUILD_DIR=build_wasm + +if "%~1" NEQ "" ( + set "BUILD_DIR=%~1" +) + pushd "%~dp0" call tools\emsdk\emsdk.bat install 3.1.10 call tools\emsdk\emsdk.bat activate 3.1.10 -popd \ No newline at end of file +emcmake cmake -B %BUILD_DIR% -S . + +popd +endlocal \ No newline at end of file