Skip to content

Commit

Permalink
CMake: Provide WASM compile, link flags to test_lpython
Browse files Browse the repository at this point in the history
Also provide --exp-wasm-bigint flag in CI
  • Loading branch information
Shaikh-Ubaid committed Jun 20, 2023
1 parent 550d1e7 commit e6103ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten
which node
node -v
node src/lpython/tests/test_lpython.js
node --experimental-wasm-bigint src/lpython/tests/test_lpython.js
test_pip_pkgs:
name: Test PIP Installable Packages
Expand Down
8 changes: 8 additions & 0 deletions src/lpython/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ endif()
# Add one main test suite for LPython, composed of many individual cpp files:
add_executable(test_lpython ${SRC})
target_link_libraries(test_lpython lpython_lib p::doctest)
if (HAVE_BUILD_TO_WASM)
set(WASM_COMPILE_FLAGS "-g0 -fexceptions")
set(WASM_LINK_FLAGS
"-Oz -g0 -fexceptions -Wall -Wextra -s ASSERTIONS -s ALLOW_MEMORY_GROWTH=1 -s WASM_BIGINT"
)
set_target_properties(test_lpython PROPERTIES COMPILE_FLAGS ${WASM_COMPILE_FLAGS})
set_target_properties(test_lpython PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS})
endif()
add_test(test_lpython ${PROJECT_BINARY_DIR}/test_lpython)

set_target_properties(test_lpython PROPERTIES
Expand Down

0 comments on commit e6103ca

Please sign in to comment.