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 #