Skip to content

Commit ca122e7

Browse files
committed
CMake: Provide WASM compile, link flags to test_lpython
1 parent 4d923ba commit ca122e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lpython/tests/CMakeLists.txt

+8
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)