61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
name: Emscripten
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build-linux:
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
name: Emscripten-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}}
|
|
runs-on: ubuntu-latest
|
|
container: emscripten/emsdk
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
build_type: [Release, Debug]
|
|
extra: [no-custom-prefix, custom-prefix]
|
|
lib: [static]
|
|
std: [98, 11, 14, 17, 20]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Dependencies
|
|
run: |
|
|
apt-get update
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
|
|
cmake \
|
|
ninja-build
|
|
|
|
- name: Setup C++98 Environment
|
|
if: matrix.std == '98'
|
|
run: |
|
|
echo 'CXXFLAGS=-Wno-error=variadic-macros -Wno-error=long-long ${{env.CXXFLAGS}}' >> $GITHUB_ENV
|
|
|
|
- name: Configure
|
|
env:
|
|
CXXFLAGS: -Wall -Wextra -Wsign-conversion -Wtautological-compare -Wformat-nonliteral -Wundef -Werror -Wno-error=wasm-exception-spec ${{env.CXXFLAGS}}
|
|
run: |
|
|
cmake -S . -B build_${{matrix.build_type}} \
|
|
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
|
|
-DCMAKE_AR=$(which emar) \
|
|
-DCMAKE_C_COMPILER=$(which emcc) \
|
|
-DCMAKE_CXX_COMPILER=$(which em++) \
|
|
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
|
|
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
|
|
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
|
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
|
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
|
|
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
|
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
|
|
-DCMAKE_RANLIB=$(which emranlib) \
|
|
-DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \
|
|
-G Ninja \
|
|
-Werror
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake --build build_${{matrix.build_type}} \
|
|
--config ${{matrix.build_type}}
|