Skip to content
Snippets Groups Projects

feat : added ASAN support

Merged Grégoire Kubler requested to merge hrouis/aidge_backend_cuda:feat/support_ASAN into dev
+ 15
0
@@ -12,6 +12,7 @@ set(module_name _${project}) # target name
@@ -12,6 +12,7 @@ set(module_name _${project}) # target name
project(${project})
project(${project})
 
set(CXX_STANDARD 14)
##############################################
##############################################
# Define options
# Define options
@@ -19,6 +20,7 @@ option(PYBIND "python binding" ON)
@@ -19,6 +20,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 +55,19 @@ target_link_libraries(${module_name}
@@ -53,6 +55,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
Loading