File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
option (ENABLE_ADDRESS_SANITIZER OFF )
2
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
3
3
if (ENABLE_ADDRESS_SANITIZER )
4
4
add_compile_options (-fsanitize=address )
5
5
add_link_options (-fsanitize=address )
6
- message (STATUS "Enabled clang address sanitizer" )
6
+ message (STATUS "Enabled address sanitizer" )
7
7
endif ()
8
8
if (ENABLE_UB_SANITIZER )
9
9
add_compile_options (-fsanitize=undefined )
10
10
add_link_options (-fsanitize=undefined )
11
- message (STATUS "Enabled clang UB sanitizer" )
11
+ message (STATUS "Enabled UB sanitizer" )
12
12
endif ()
13
13
else ()
14
- message (WARNING "Sanitizers are supported on clang compiler only! Switch your compiler to clang to enable it " )
14
+ message (WARNING "Sanitizers are supported on gcc and clang compilers only! " )
15
15
endif ()
You can’t perform that action at this time.
0 commit comments