diff --git a/bazel/external/BUILD b/bazel/external/BUILD index 3c1cc863b193..03a47a410703 100644 --- a/bazel/external/BUILD +++ b/bazel/external/BUILD @@ -5,6 +5,7 @@ cc_library( srcs = [":empty.cc"], deps = [ "@com_github_lightstep_lightstep_tracer_cpp//:lightstep", + "@com_google_googletest//:gtest", ], ) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 21e8361def6c..c1839da0a506 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -224,6 +224,8 @@ def envoy_dependencies(path = "@envoy_deps//", skip_com_google_protobuf = False, com_github_gabime_spdlog(repository) if not ("lightstep" in skip_targets or "com_github_lightstep_lightstep_tracer_cpp" in existing_rule_keys): com_github_lightstep_lightstep_tracer_cpp(repository) + if not ("googletest" in skip_targets or "com_google_googletest" in existing_rule_keys): + com_google_googletest() if not (skip_com_google_protobuf or "com_google_protobuf" in existing_rule_keys): com_google_protobuf() @@ -288,6 +290,17 @@ def com_github_lightstep_lightstep_tracer_cpp(repository = ""): actual="@com_github_lightstep_lightstep_tracer_cpp//:lightstep", ) +def com_google_googletest(): + native.git_repository( + name = "com_google_googletest", + remote = "https://github.com/google/googletest", + commit = "43863938377a9ea1399c0596269e0890b5c5515a", + ) + native.bind( + name = "googletest", + actual = "@com_google_googletest//:gtest", + ) + def com_google_protobuf(): # TODO(htuch): This can switch back to a point release http_archive at the next # release (> 3.4.1), we need HEAD proto_library support and diff --git a/bazel/target_recipes.bzl b/bazel/target_recipes.bzl index 0cab65e9b0e7..c27263d963b8 100644 --- a/bazel/target_recipes.bzl +++ b/bazel/target_recipes.bzl @@ -9,7 +9,6 @@ TARGET_RECIPES = { # TODO(htuch): This shouldn't be a build recipe, it's a tooling dependency # that is external to Bazel. "gcovr": "gcovr", - "googletest": "googletest", "tcmalloc_and_profiler": "gperftools", "http_parser": "http-parser", "luajit": "luajit", diff --git a/ci/build_container/build_recipes/googletest.sh b/ci/build_container/build_recipes/googletest.sh deleted file mode 100755 index e4f6b061dd61..000000000000 --- a/ci/build_container/build_recipes/googletest.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -VERSION=43863938377a9ea1399c0596269e0890b5c5515a - -wget -O googletest-"$VERSION".tar.gz https://github.com/google/googletest/archive/"$VERSION".tar.gz -tar xf googletest-"$VERSION".tar.gz -cd googletest-"$VERSION" -cmake -DCMAKE_INSTALL_PREFIX:PATH="$THIRDPARTY_BUILD" \ - -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${CPPFLAGS}" \ - -DCMAKE_C_FLAGS:STRING="${CFLAGS} ${CPPFLAGS}" \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo . -make VERBOSE=1 install diff --git a/ci/prebuilt/BUILD b/ci/prebuilt/BUILD index dc0a46a17592..cadae6ce5898 100644 --- a/ci/prebuilt/BUILD +++ b/ci/prebuilt/BUILD @@ -35,19 +35,6 @@ cc_library( deps = [":event"], ) -cc_library( - name = "googletest", - srcs = [ - "thirdparty_build/lib/libgmock.a", - "thirdparty_build/lib/libgtest.a", - ], - hdrs = glob([ - "thirdparty_build/include/gmock/**/*.h", - "thirdparty_build/include/gtest/**/*.h", - ]), - includes = ["thirdparty_build/include"], -) - cc_library( name = "http_parser", srcs = ["thirdparty_build/lib/libhttp_parser.a"],