Skip to content

Commit 0745c3a

Browse files
committed
Add Emscripten target to CI
No testing, just making sure it compiles, and keeps on doing so. Ref: #75
1 parent 6f5cda4 commit 0745c3a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,17 @@ jobs:
336336
- name: stats
337337
run: |
338338
make stats
339+
340+
emscripten:
341+
runs-on: ubuntu-latest
342+
steps:
343+
- uses: actions/checkout@v3
344+
- uses: mymindstorm/setup-emsdk@v13
345+
- name: check emsdk
346+
run: emcc -v
347+
- name: build
348+
run: |
349+
emcmake cmake -B build
350+
emmake make -C build qjs_wasm -j$(getconf _NPROCESSORS_ONLN)
351+
- name: result
352+
run: ls -lh build

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ target_include_directories(qjs PUBLIC
165165
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
166166
)
167167

168+
if(EMSCRIPTEN)
169+
add_executable(qjs_wasm ${qjs_sources})
170+
target_compile_definitions(qjs_wasm PRIVATE ${qjs_defines})
171+
target_link_libraries(qjs_wasm m)
172+
endif()
173+
168174

169175
# QuickJS bytecode compiler
170176
#

0 commit comments

Comments
 (0)