Skip to content

Commit

Permalink
meson: add emscripten support
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Sep 27, 2023
1 parent 8250fb2 commit bec05da
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/on_PR_meson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions em.txt
Original file line number Diff line number Diff line change
@@ -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'

5 comments on commit bec05da

@1div0
Copy link
Collaborator

@1div0 1div0 commented on bec05da Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Host machine could be for instance AArch64 CPU based. Could anybody w/ Apple Silicon try that?

@neheb
Copy link
Collaborator Author

@neheb neheb commented on bec05da Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI has no aarch64, except for QEMU which is glacial.

@1div0
Copy link
Collaborator

@1div0 1div0 commented on bec05da Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U meant MS GH CI, right? At the moment it is true. Ever heard about Ampere chips? x86-64 is not the only option.

@neheb
Copy link
Collaborator Author

@neheb neheb commented on bec05da Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit was mostly about adding CI. No other changes.

@1div0
Copy link
Collaborator

@1div0 1div0 commented on bec05da Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK then. Thank U anyway.

Please sign in to comment.