Skip to content

Commit 565cd03

Browse files
committed
CMake: Provide WASM compile, link flags to test_lpython
Also provide --exp-wasm-bigint flag in CI
1 parent 4d923ba commit 565cd03

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten
194194
which node
195195
node -v
196-
node src/lpython/tests/test_lpython.js
196+
node --experimental-wasm-bigint src/lpython/tests/test_lpython.js
197197
198198
test_pip_pkgs:
199199
name: Test PIP Installable Packages

src/lpython/tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ endif()
3232
# Add one main test suite for LPython, composed of many individual cpp files:
3333
add_executable(test_lpython ${SRC})
3434
target_link_libraries(test_lpython lpython_lib p::doctest)
35+
if (HAVE_BUILD_TO_WASM)
36+
set(WASM_COMPILE_FLAGS "-g0 -fexceptions")
37+
set(WASM_LINK_FLAGS
38+
"-Oz -g0 -fexceptions -Wall -Wextra -s ASSERTIONS -s ALLOW_MEMORY_GROWTH=1 -s WASM_BIGINT"
39+
)
40+
set_target_properties(test_lpython PROPERTIES COMPILE_FLAGS ${WASM_COMPILE_FLAGS})
41+
set_target_properties(test_lpython PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS})
42+
endif()
3543
add_test(test_lpython ${PROJECT_BINARY_DIR}/test_lpython)
3644

3745
set_target_properties(test_lpython PROPERTIES

0 commit comments

Comments
 (0)