From c831b98d2ed0571cda9b3ed7acaddd0df2c5a934 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Fri, 27 Jan 2023 18:37:14 -0800 Subject: Speed up tests by matrixing asan/ubsan x debug/release (#2081) Will shorten the critical path after wasm2c is running SIMD tests --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c02bebf4..28f1c43d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,6 +217,7 @@ function(sanitizer NAME FLAGS) set(USE_SANITIZER TRUE PARENT_SCOPE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}" PARENT_SCOPE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}" PARENT_SCOPE) + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} ${FLAGS}" PARENT_SCOPE) endif () endfunction() sanitizer(USE_ASAN "-fsanitize=address") @@ -618,6 +619,18 @@ if (BUILD_TOOLS) endif () if (BUILD_TESTS) + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} -g -O0") + endif () + + if (DEFINED CMAKE_OSX_SYSROOT) + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + endif () + + if (DEFINED ENV{WASM2C_CFLAGS}) + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} $ENV{WASM2C_CFLAGS}") + endif () + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -681,7 +694,7 @@ if (BUILD_TESTS) set(RUN_TESTS_PY ${WABT_SOURCE_DIR}/test/run-tests.py) add_custom_target(run-tests - COMMAND ${PYTHON_EXECUTABLE} ${RUN_TESTS_PY} --bindir $ + COMMAND ${CMAKE_COMMAND} -E env WASM2C_CC=${CMAKE_C_COMPILER} WASM2C_CFLAGS=${WASM2C_CFLAGS} ${PYTHON_EXECUTABLE} ${RUN_TESTS_PY} --bindir $ DEPENDS ${WABT_EXECUTABLES} WORKING_DIRECTORY ${WABT_SOURCE_DIR} USES_TERMINAL -- cgit v1.2.3