Skip to content
Snippets Groups Projects
Commit e53ca380 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

feat : added ASAN support

parent eeba5ca4
No related branches found
No related tags found
2 merge requests!15version 0.2.0,!11feat : added ASAN support
...@@ -19,6 +19,7 @@ option(PYBIND "python binding" ON) ...@@ -19,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
...@@ -53,6 +54,19 @@ target_link_libraries(${module_name} ...@@ -53,6 +54,19 @@ target_link_libraries(${module_name}
cudnn cudnn
) )
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()
if(TEST) if(TEST)
target_link_libraries(${module_name} target_link_libraries(${module_name}
PUBLIC PUBLIC
......
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