diff --git a/.devcontainer/emscripten_dev/Dockerfile b/.devcontainer/emscripten_dev/Dockerfile index 77e5423a..5cc3467f 100644 --- a/.devcontainer/emscripten_dev/Dockerfile +++ b/.devcontainer/emscripten_dev/Dockerfile @@ -1,6 +1,7 @@ FROM emscripten/emsdk:3.1.42 RUN apt-get update && apt-get install -y \ + bash-completion \ ninja-build \ wget \ unzip diff --git a/.devcontainer/emscripten_dev/devcontainer.json b/.devcontainer/emscripten_dev/devcontainer.json index d334f5db..71a8e1ba 100644 --- a/.devcontainer/emscripten_dev/devcontainer.json +++ b/.devcontainer/emscripten_dev/devcontainer.json @@ -19,6 +19,7 @@ "cmake.configureArgs": [ "-DCMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake", "-DFLATBUFFERS_FLATC_EXECUTABLE=/usr/bin/flatc", + "-DCMAKE_BUILD_TYPE=MinSizeRel", "-DKWGEN_EXECUTABLE=/usr/bin/kwgen" ], "cmake.buildDirectory": "${workspaceFolder}/build.em", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8814b9a..856407d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,9 @@ jobs: - name: Test working-directory: packages/cxx-frontend/examples run: | - node dump.mjs + for i in *.mjs; do + node dump.mjs + done - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/packages/cxx-frontend/package.json b/packages/cxx-frontend/package.json index 835c611e..ae0535f8 100644 --- a/packages/cxx-frontend/package.json +++ b/packages/cxx-frontend/package.json @@ -17,7 +17,9 @@ "keywords": [ "c++", "compiler", + "lexer", "parser", + "preprocessor", "syntax" ], "author": { diff --git a/scripts/build-emscripten.sh b/scripts/build-emscripten.sh index 2416e17d..0c62c62a 100755 --- a/scripts/build-emscripten.sh +++ b/scripts/build-emscripten.sh @@ -8,13 +8,15 @@ project_root=$(cd "$me/.." && pwd) CMAKE_CONFIGURE_OPTIONS=" -DCMAKE_INSTALL_PREFIX=build.em/install/usr \ --DCMAKE_BUILD_TYPE=MinSizeRel \ --DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1 \ --DKWGEN_EXECUTABLE=/usr/bin/kwgen \ --DFLATBUFFERS_FLATC_EXECUTABLE=/usr/bin/flatc" +-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-MinSizeRel} \ +-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${CMAKE_INTERPROCEDURAL_OPTIMIZATION:-1} \ +-DKWGEN_EXECUTABLE=${KWGEN_EXECUTABLE:-/usr/bin/kwgen} \ +-DFLATBUFFERS_FLATC_EXECUTABLE=${FLATBUFFERS_FLATC_EXECUTABLE:-/usr/bin/flatc}" if [ ! -z "${CODESPACES}" ] && [ ! -z "${EMSDK}" ]; then - cmake -G Ninja ${CMAKE_CONFIGURE_OPTIONS} -S ${project_root} -B ${project_root}/build.em + if [ ! -d "${project_root}/build.em" ]; then + cmake -G Ninja ${CMAKE_CONFIGURE_OPTIONS} -S ${project_root} -B ${project_root}/build.em + fi cmake --build $project_root/build.em exit 0 fi diff --git a/src/js/CMakeLists.txt b/src/js/CMakeLists.txt index 3f7232d1..2ca914cf 100644 --- a/src/js/CMakeLists.txt +++ b/src/js/CMakeLists.txt @@ -30,6 +30,7 @@ target_link_libraries(cxx-js cxx-parser) target_link_options(cxx-js PUBLIC "SHELL:--bind" "SHELL:-s ENVIRONMENT=web" + "SHELL:-s EXPORT_ES6=1" "SHELL:-s WASM_ASYNC_COMPILATION=1" "SHELL:-s MODULARIZE=1" "SHELL:-s MALLOC=emmalloc" @@ -37,6 +38,5 @@ target_link_options(cxx-js PUBLIC "SHELL:-s FILESYSTEM=0" "SHELL:-s NO_DYNAMIC_EXECUTION=1" "SHELL:-s WASM_BIGINT=1" - "SHELL:--extern-post-js ${CMAKE_CURRENT_SOURCE_DIR}/cxx/suffix.js" ) diff --git a/src/js/cxx/suffix.js b/src/js/cxx/suffix.js deleted file mode 100644 index e15fc5fd..00000000 --- a/src/js/cxx/suffix.js +++ /dev/null @@ -1,2 +0,0 @@ - -export default Module;