From 340b26badaac3eddf89e39e0cc8f293e09808fc3 Mon Sep 17 00:00:00 2001 From: Jaci Brunning Date: Tue, 17 Jul 2018 13:48:02 +0800 Subject: [PATCH] Use ASAN when on Clang (#1187) This currently only affects MacOS builds, as that's the only platform where clang is used. --- shared/googletest.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shared/googletest.gradle b/shared/googletest.gradle index fa471f6dc2..6b40e36b92 100644 --- a/shared/googletest.gradle +++ b/shared/googletest.gradle @@ -10,4 +10,13 @@ model { staticConfigs = project.staticGtestConfigs } } + binaries { + withType(GoogleTestTestSuiteBinarySpec) { + if (toolChain instanceof Clang) { + println "Clang Detected - Using ASAN" + cppCompiler.args << '-fsanitize=address' + linker.args << '-fsanitize=address' + } + } + } }