Fixup for r301007: Restrict the -D hack to Darwin.
git-svn-id: svn://svn.chromium.org/llvm-project/llvm/trunk/lib/Fuzzer@301017 0b72dbe1-c17f-4bc7-b9db-2b4152be0356
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d44c12d..7c00db6 100644
--- a/CMakeLists.txt
+++ b/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}")