This cross-compilation is tested via GitHub Actions from an ubuntu/x64 machine.
.github folder
actions/cpp-tests/action.yaml: use the same profile both for build and for host.
workflows/test.yml: add js-emscripten-wasm job.
emscripten folder
CMakeLists.txt: CMake code to generate the emscripten binaries, cqasm_emscripten.js and cqasm_emscripten.wasm.
emscripten_wrapper.hpp: define the bindings that are exported to Javascript callers: get_version, parse_string_to_json, and analyze_string_to_json.
emscripten_wrapper.cpp: connect the bindings to their implementations, V3xAnalyzer methods.
test_cqasm.js: exercise the bindings via different test cases: get version, parse returning an error or an AST, and analyze returning an error or an AST.
src folder
CMakeLists.txt: when building for emscripten, we check out and build ANTLR, fmt, and tree-gen code, so that exceptions risen in this code can be correctly treated in the generated wasm code.
Root folder
CMakeLists.txt: for emscripten binaries, we have to enable exception support.
conanfile.py: update to use tree-gen Conan package.
libqasm can now be cross-compiled to emscripten.
This cross-compilation is tested via GitHub Actions from an ubuntu/x64 machine.
.github
folderactions/cpp-tests/action.yaml
: use the same profile both for build and for host.workflows/test.yml
: addjs-emscripten-wasm
job.emscripten
folderCMakeLists.txt
: CMake code to generate the emscripten binaries,cqasm_emscripten.js
andcqasm_emscripten.wasm
.emscripten_wrapper.hpp
: define the bindings that are exported to Javascript callers:get_version
,parse_string_to_json
, andanalyze_string_to_json
.emscripten_wrapper.cpp
: connect the bindings to their implementations,V3xAnalyzer
methods.test_cqasm.js
: exercise the bindings via different test cases: get version, parse returning an error or an AST, and analyze returning an error or an AST.src
folderCMakeLists.txt
: when building for emscripten, we check out and build ANTLR,fmt
, andtree-gen
code, so that exceptions risen in this code can be correctly treated in the generated wasm code.Root folder
CMakeLists.txt
: for emscripten binaries, we have to enable exception support.conanfile.py
: update to use tree-gen Conan package.Dockerfile
: install latest emsdk, install CMake 3.28, invokenode
from emsdk.README.md
: update.setup.py
: use the same profile both for build and for host.