Fixup for r301007: Restrict the -D hack to Darwin.
authorKuba Mracek <mracek@apple.com>
Fri, 21 Apr 2017 18:19:56 +0000 (18:19 +0000)
committerKuba Mracek <mracek@apple.com>
Fri, 21 Apr 2017 18:19:56 +0000 (18:19 +0000)
llvm-svn: 301017

llvm/lib/Fuzzer/CMakeLists.txt

index d44c12d..7c00db6 100644 (file)
@@ -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}")