Skip to content
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake Vcpkg Emscripten
on:
# push:
# branches: [ "main" ]
pull_request:
# branches: [ "main" ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install libs
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y xorg-dev
sudo apt-get install -y libglu1-mesa-dev
- uses: lukka/get-cmake@latest
- name: Install vcpgk
uses: lukka/run-vcpkg@v1)
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
# runVcpkgInstall: true
# vcpkgJsonGlob: '**/vcpkg.json'
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v11
# with:
# version: 2.0.10
- name: Verify
run: emcc -v
- name: Create build directory
run: mkdir build
- name: Configure CMake
run: emcmake cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DVCPKG_TARGET_TRIPLET=wasm32-emscripten -DCMAKE_BUILD_TYPE=Release
- name: Build
run: emmake make -C build