Commit 4ee6ad97 authored by Baptiste Esteban's avatar Baptiste Esteban
Browse files

Add shared-libasan for clang build of tests

parent 5f24c33d
Pipeline #26625 failed with stages
in 15 minutes and 54 seconds
# Copy a script to launch ASAN for python extensions
set(SANITIZE_SCRIPT "")
if (UNIX AND NOT CYGWIN)
string(FIND "${CMAKE_CXX_FLAGS}" "-fsanitize=address" USE_SANITIZER)
if (USE_SANITIZER GREATER -1)
set(SANITIZE_SCRIPT "asan-pylena-test")
file(COPY ${SANITIZE_SCRIPT} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options("-shared-libasan")
add_link_options("-shared-libasan")
endif()
endif()
endif()
# Python module for testing
pybind11_add_module(pylena_test pylena_test.cpp)
target_link_libraries(pylena_test PRIVATE Pylene Pylene-numpy)
......@@ -10,13 +24,6 @@ target_link_libraries(pylena_extension PRIVATE Pylene Pylene-numpy)
target_include_directories(pylena_extension PRIVATE ${CONAN_INCLUDE_DIRS_PYBIND11} ${PYTHON_INCLUDE_DIRS}) # TO REMOVE WHEN cmake_find_package FOR PYBIND11 WILL BE FIXED
add_dependencies(build-tests pylena_extension)
# Copy a script to launch ASAN for python extensions
set(SANITIZE_SCRIPT "")
if (UNIX AND NOT CYGWIN)
set(SANITIZE_SCRIPT "asan-pylena-test")
file(COPY ${SANITIZE_SCRIPT} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()
function(add_python_test filename)
file(COPY ${filename} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endfunction(add_python_test)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment