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
This commit is contained in:
Saúl Ibarra Corretgé 2023-11-30 10:00:03 +01:00
parent 6f5cda46e7
commit 0745c3a12b
2 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -165,6 +165,12 @@ target_include_directories(qjs PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
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
#