Make sure USE_SANITIZER is not empty before foreach
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
parent
ca4b5a368f
commit
dc57685ac3
1 changed files with 13 additions and 11 deletions
|
@ -173,7 +173,8 @@ endif()
|
||||||
|
|
||||||
# Make it easy to enable Clang's/gcc's analyzers
|
# Make it easy to enable Clang's/gcc's analyzers
|
||||||
set(USE_SANITIZER "" CACHE STRING "Sanitizers to enable on the build.")
|
set(USE_SANITIZER "" CACHE STRING "Sanitizers to enable on the build.")
|
||||||
foreach(san "${USE_SANITIZER}")
|
if(NOT("${USE_SANITIZER}" STREQUAL ""))
|
||||||
|
foreach(san "${USE_SANITIZER}")
|
||||||
message(STATUS "Enabling sanitizer: '${san}'")
|
message(STATUS "Enabling sanitizer: '${san}'")
|
||||||
|
|
||||||
if("${san}" STREQUAL address)
|
if("${san}" STREQUAL address)
|
||||||
|
@ -185,7 +186,8 @@ foreach(san "${USE_SANITIZER}")
|
||||||
add_compile_options("-fsanitize=${san}")
|
add_compile_options("-fsanitize=${san}")
|
||||||
link_libraries("-fsanitize=${san}")
|
link_libraries("-fsanitize=${san}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue