From: Kuba Mracek Date: Fri, 21 Apr 2017 18:19:56 +0000 (+0000) Subject: Fixup for r301007: Restrict the -D hack to Darwin. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=768a04e3df29dd583fee466bbc0ddbeb8ded9479;p=llvm Fixup for r301007: Restrict the -D hack to Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301017 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Fuzzer/CMakeLists.txt b/lib/Fuzzer/CMakeLists.txt index d44c12de3e1..7c00db657bb 100644 --- a/lib/Fuzzer/CMakeLists.txt +++ b/lib/Fuzzer/CMakeLists.txt @@ -1,14 +1,16 @@ include(CheckCXXSourceCompiles) -CHECK_CXX_SOURCE_COMPILES(" - static thread_local int blah; - int main() { - return 0; - } - " HAS_THREAD_LOCAL) +if( APPLE ) + CHECK_CXX_SOURCE_COMPILES(" + static thread_local int blah; + int main() { + return 0; + } + " HAS_THREAD_LOCAL) -if( NOT HAS_THREAD_LOCAL ) + if( NOT HAS_THREAD_LOCAL ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dthread_local=__thread") + endif() endif() set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS}")