From 5bfe8a8e511296fb0743ecb0420642e9ef5e2285 Mon Sep 17 00:00:00 2001 From: Alexander Haase Date: Tue, 14 Jun 2016 01:12:11 +0200 Subject: [PATCH] Support multiple targets in add_sanitizers. --- cmake/FindSanitizers.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/FindSanitizers.cmake b/cmake/FindSanitizers.cmake index 2be9d4a..627ee24 100644 --- a/cmake/FindSanitizers.cmake +++ b/cmake/FindSanitizers.cmake @@ -52,9 +52,11 @@ function(sanitizer_add_blacklist_file FILE) "SanitizerBlacklist" "SanBlist") endfunction() -function(add_sanitizers TARGET) - add_sanitize_address(${TARGET}) - add_sanitize_thread(${TARGET}) - add_sanitize_memory(${TARGET}) - add_sanitize_undefined(${TARGET}) +function(add_sanitizers ...) + foreach (TARGET ${ARGV}) + add_sanitize_address(${TARGET}) + add_sanitize_thread(${TARGET}) + add_sanitize_memory(${TARGET}) + add_sanitize_undefined(${TARGET}) + endforeach () endfunction(add_sanitizers)