Index: llvm/lib/Testing/Support/CMakeLists.txt =================================================================== --- llvm/lib/Testing/Support/CMakeLists.txt +++ 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 Index: llvm/utils/unittest/CMakeLists.txt =================================================================== --- llvm/utils/unittest/CMakeLists.txt +++ llvm/utils/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