summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Testing/Support/CMakeLists.txt4
-rw-r--r--third-party/unittest/CMakeLists.txt4
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Testing/Support/CMakeLists.txt b/llvm/lib/Testing/Support/CMakeLists.txt
index 81774eb171ca..385d8eca2daa 100644
--- a/llvm/lib/Testing/Support/CMakeLists.txt
+++ b/llvm/lib/Testing/Support/CMakeLists.txt
@@ -1,3 +1,7 @@
+# Do not build unittest libraries automatically, they will be pulled in
+# by unittests if these are built.
+set(EXCLUDE_FROM_ALL ON)
+
add_llvm_library(LLVMTestingSupport
Annotations.cpp
Error.cpp
diff --git a/third-party/unittest/CMakeLists.txt b/third-party/unittest/CMakeLists.txt
index 0e54e0e57c35..302e9e0e8440 100644
--- a/third-party/unittest/CMakeLists.txt
+++ b/third-party/unittest/CMakeLists.txt
@@ -38,6 +38,10 @@ if (HAVE_LIBPTHREAD)
list(APPEND LIBS pthread)
endif()
+# Do not build unittest libraries automatically, they will be pulled in
+# by unittests if these are built.
+set(EXCLUDE_FROM_ALL ON)
+
add_llvm_library(llvm_gtest
googletest/src/gtest-all.cc
googlemock/src/gmock-all.cc