From 8d8c0f7a4e26f8d9cdb23850f9f86f6c85a16d91 Mon Sep 17 00:00:00 2001 From: Alexander Haase Date: Fri, 13 May 2016 14:59:11 +0200 Subject: [PATCH] Bugfixes. --- cmake/FindASan.cmake | 2 +- cmake/sanitize-helpers.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindASan.cmake b/cmake/FindASan.cmake index 7605df1..734a960 100644 --- a/cmake/FindASan.cmake +++ b/cmake/FindASan.cmake @@ -26,7 +26,7 @@ option(SANITIZE_ADDRESS "Enable AddressSanitizer for sanitized targets." Off) set(FLAG_CANDIDATES # Clang 3.2+ use this version. The no-omit-frame-pointer option is optional. - "-g -sanitize=address -fno-omit-frame-pointer" + "-g -fsanitize=address -fno-omit-frame-pointer" "-g -fsanitize=address" # Older deprecated flag for ASan diff --git a/cmake/sanitize-helpers.cmake b/cmake/sanitize-helpers.cmake index 7ea90cc..88da66e 100644 --- a/cmake/sanitize-helpers.cmake +++ b/cmake/sanitize-helpers.cmake @@ -117,7 +117,7 @@ function (sanitizer_check_compiler_flags FLAG_CANDIDATES NAME PREFIX) if (${PREFIX}_FLAG_DETECTED) # If compiler is a GNU compiler, search for static flag, if # SANITIZE_LINK_STATIC is enabled. - if (SANITIZE_LINK_STATIC) + if (SANITIZE_LINK_STATIC AND (${COMPILER} STREQUAL "GNU")) string(TOLOWER ${PREFIX} PREFIX_lower) sanitizer_check_compiler_flag( "-static-lib${PREFIX_lower}" ${LANG}