Skip to content

Commit

Permalink
Updated emconfig.bat to setup the build directory using emcmake
Browse files Browse the repository at this point in the history
  • Loading branch information
visrealm committed Sep 5, 2023
1 parent 8091bf8 commit e41c76b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/emulator-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
23 changes: 22 additions & 1 deletion emconfig.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
:: Setup WebAssembly build
:: Takes a single argument bing the build directory (default: build_wasm)
::
:: Usage:
:: ./emconfig.bat <build_dir>
::
:: 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
emcmake cmake -B %BUILD_DIR% -S .

popd
endlocal

0 comments on commit e41c76b

Please sign in to comment.