diff --git a/llvm/lib/Testing/Support/CMakeLists.txt b/llvm/lib/Testing/Support/CMakeLists.txt --- 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 --- a/third-party/unittest/CMakeLists.txt +++ b/third-party/unittest/CMakeLists.txt @@ -38,6 +38,10 @@ 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