From 0745c3a12b345cd0bf7eabd1f9aad7f2198cf512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 30 Nov 2023 10:00:03 +0100 Subject: [PATCH] Add Emscripten target to CI No testing, just making sure it compiles, and keeps on doing so. Ref: https://github.com/quickjs-ng/quickjs/issues/75 --- .github/workflows/ci.yml | 14 ++++++++++++++ CMakeLists.txt | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a927f83..8bfb7e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -336,3 +336,17 @@ jobs: - name: stats run: | make stats + + emscripten: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: mymindstorm/setup-emsdk@v13 + - name: check emsdk + run: emcc -v + - name: build + run: | + emcmake cmake -B build + emmake make -C build qjs_wasm -j$(getconf _NPROCESSORS_ONLN) + - name: result + run: ls -lh build diff --git a/CMakeLists.txt b/CMakeLists.txt index 051579e..d485cf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,6 +165,12 @@ target_include_directories(qjs PUBLIC $ ) +if(EMSCRIPTEN) + add_executable(qjs_wasm ${qjs_sources}) + target_compile_definitions(qjs_wasm PRIVATE ${qjs_defines}) + target_link_libraries(qjs_wasm m) +endif() + # QuickJS bytecode compiler #