Make sure USE_SANITIZER is not empty before foreach

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-02-29 11:53:33 -05:00 committed by eboasson
parent ca4b5a368f
commit dc57685ac3

View file

@ -173,6 +173,7 @@ endif()
# Make it easy to enable Clang's/gcc's analyzers
set(USE_SANITIZER "" CACHE STRING "Sanitizers to enable on the build.")
if(NOT("${USE_SANITIZER}" STREQUAL ""))
foreach(san "${USE_SANITIZER}")
message(STATUS "Enabling sanitizer: '${san}'")
@ -186,6 +187,7 @@ foreach(san "${USE_SANITIZER}")
link_libraries("-fsanitize=${san}")
endif()
endforeach()
endif()
include(GNUInstallDirs)