diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -4417,22 +4417,39 @@ cc_library( name = "TestingSupport", testonly = True, - srcs = glob([ - "lib/Testing/Support/*.cpp", - "lib/Testing/Support/*.h", - ]), - hdrs = glob([ - "include/llvm/Testing/Support/*.h", - ]), + srcs = glob( + [ + "lib/Testing/Support/*.cpp", + "lib/Testing/Support/*.h", + ], + exclude = ["lib/Testing/Support/Annotations.cpp"], + ), + hdrs = glob( + [ + "include/llvm/Testing/Support/*.h", + ], + exclude = ["include/llvm/Testing/Support/Annotations.h"], + ), copts = llvm_copts, deps = [ ":Support", + ":TestingAnnotations", ":config", "//third-party/unittest:gmock", "//third-party/unittest:gtest", ], ) +# Split out of TestingSupport to allow using this with a different gmock/gtest version. +cc_library( + name = "TestingAnnotations", + testonly = True, + srcs = ["lib/Testing/Support/Annotations.cpp"], + hdrs = ["include/llvm/Testing/Support/Annotations.h"], + copts = llvm_copts, + deps = [":Support"], +) + ################################################################################ # Begin testonly binary utilities