From 8cd8f51516c4635283a791bb1bcfbc289a3501fa Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 26 Feb 2014 21:54:39 +0000 Subject: Append -D__func__=__FUNCTION__ to SANITIZER_COMMON_CFLAGS This way it gets picked up for all sanitizer libs, both sanitizer_common and asan. I believe those are the only libs that build with asan. There should be no need to set the __func__ definition inside clang_compile. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202303 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 438a5bf04..a31c1c638 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,12 @@ if(COMPILER_RT_ENABLE_WERROR) add_definitions_if(COMPILER_RT_HAS_WX_FLAG /WX) endif() +# Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP. +CHECK_SYMBOL_EXISTS(__func__ "" COMPILER_RT_HAS_FUNC) +if(NOT COMPILER_RT_HAS_FUNC) + list(APPEND SANITIZER_COMMON_CFLAGS -D__func__=__FUNCTION__) +endif() + # Provide some common commmandline flags for Sanitizer runtimes. append_if(SANITIZER_COMMON_CFLAGS COMPILER_RT_HAS_FPIC_FLAG -fPIC) append_if(SANITIZER_COMMON_CFLAGS COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin) -- cgit v1.2.3