summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexander Lanin <alex@lanin.de>2020-08-31 22:01:22 +0200
committerGitHub <noreply@github.com>2020-08-31 22:01:22 +0200
commit799fd241ebbfa856e0102de2652005f3dc28f9ce (patch)
treea1930497e1e7ae61a40620ba784e313a85da91c6 /cmake
parentcb407bc07239a305a2ec39fdb85024f1c4871005 (diff)
downloadccache-799fd241ebbfa856e0102de2652005f3dc28f9ce.tar.gz
Merge address and UB sanitizer (#647)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/StandardSettings.cmake10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmake/StandardSettings.cmake b/cmake/StandardSettings.cmake
index a30f8207..755ff9f2 100644
--- a/cmake/StandardSettings.cmake
+++ b/cmake/StandardSettings.cmake
@@ -38,15 +38,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|Clang$")
list(APPEND SANITIZERS "thread")
endif()
- if(SANITIZERS)
- string(REPLACE ";" " " LIST_OF_SANITIZERS "${SANITIZERS}")
+ foreach(SANITIZER IN LISTS SANITIZERS)
target_compile_options(
standard_settings
- INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
+ INTERFACE -fsanitize=${SANITIZER})
target_link_libraries(
standard_settings
- INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
- endif()
+ INTERFACE -fsanitize=${SANITIZER})
+ endforeach()
+
elseif(MSVC)
target_compile_options(standard_settings INTERFACE /std:c++latest /Zc:preprocessor /Zc:__cplusplus /D_CRT_SECURE_NO_WARNINGS)
endif()