Skip to content
Snippets Groups Projects
Commit 5fd1117a authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'feat/support_ASAN' into 'dev'

feat/support_ASAN

See merge request eclipse/aidge/aidge_core!95
parents a0b56cd9 98595eac
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ set(module_name _${project}) # target name ...@@ -11,6 +11,7 @@ set(module_name _${project}) # target name
project(${project}) project(${project})
set(CXX_STANDARD 14)
############################################## ##############################################
# Define options # Define options
...@@ -18,6 +19,7 @@ option(PYBIND "python binding" ON) ...@@ -18,6 +19,7 @@ option(PYBIND "python binding" ON)
option(WERROR "Warning as error" OFF) option(WERROR "Warning as error" OFF)
option(TEST "Enable tests" ON) option(TEST "Enable tests" ON)
option(COVERAGE "Enable coverage" OFF) option(COVERAGE "Enable coverage" OFF)
option(ENABLE_ASAN "Enable ASan (adress sanitizer) for runtime analysis of memory use (over/underflow, memory leak, ...)" OFF)
############################################## ##############################################
# Import utils CMakeLists # Import utils CMakeLists
...@@ -60,6 +62,19 @@ target_include_directories(${module_name} ...@@ -60,6 +62,19 @@ target_include_directories(${module_name}
${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src
) )
if( ${ENABLE_ASAN} )
message("Building ${module_name} with ASAN.")
set(SANITIZE_FLAGS -fsanitize=address -fno-omit-frame-pointer)
target_link_libraries(${module_name}
PUBLIC
-fsanitize=address
)
target_compile_options(${module_name}
PRIVATE
${SANITIZE_FLAGS}
)
endif()
# PYTHON BINDING # PYTHON BINDING
if (PYBIND) if (PYBIND)
generate_python_binding(${project} ${module_name}) generate_python_binding(${project} ${module_name})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment