summaryrefslogtreecommitdiffstats
path: root/lib/Fuzzer
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-04-21 18:19:56 +0000
committerKuba Mracek <mracek@apple.com>2017-04-21 18:19:56 +0000
commit768a04e3df29dd583fee466bbc0ddbeb8ded9479 (patch)
treeb71268db576fd2f603f01ee3ef717c0e88803f8f /lib/Fuzzer
parent0c01e44a151f5263a63efc13c0787e7bb4a0a0ac (diff)
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
Diffstat (limited to 'lib/Fuzzer')
-rw-r--r--lib/Fuzzer/CMakeLists.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Fuzzer/CMakeLists.txt b/lib/Fuzzer/CMakeLists.txt
index d44c12de3e16..7c00db657bbc 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}")