From bec05da697b6b17b3ddd38ce6590559c7eefc726 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 5 Sep 2023 13:12:59 -0700 Subject: [PATCH] meson: add emscripten support Signed-off-by: Rosen Penev --- .github/workflows/on_PR_meson.yaml | 14 ++++++++++++++ em.txt | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 em.txt diff --git a/.github/workflows/on_PR_meson.yaml b/.github/workflows/on_PR_meson.yaml index 1eeb6532d9..b9838e8a89 100644 --- a/.github/workflows/on_PR_meson.yaml +++ b/.github/workflows/on_PR_meson.yaml @@ -163,3 +163,17 @@ jobs: meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dcpp_std=c++20 meson compile -C "${{github.workspace}}/build" --verbose meson test -C "${{github.workspace}}/build" --verbose + Emscripten: + runs-on: ubuntu-latest + name: Emscripten + steps: + - uses: actions/checkout@v4 + - name: Install packages + run: | + python3 -m pip install meson ninja + - name: Emscripten + uses: mymindstorm/setup-emsdk@v11 + - name: Compile + run: | + meson setup "${{github.workspace}}/build" --cross-file="${{github.workspace}}/em.txt" --wrap-mode=forcefallback -Ddefault_library=static -Dwarning_level=3 -Dcpp_std=c++20 -DunitTests=disabled + meson compile -C "${{github.workspace}}/build" --verbose diff --git a/em.txt b/em.txt new file mode 100644 index 0000000000..5956c1506c --- /dev/null +++ b/em.txt @@ -0,0 +1,11 @@ +[binaries] +c = 'emcc' +cpp = 'em++' +ar = 'emar' +nm = 'emnm' + +[host_machine] +system = 'emscripten' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little'