Skip to content

Commit

Permalink
Use a native Bazel dep for Googletest. (#2009)
Browse files Browse the repository at this point in the history
Fixes #2007

Signed-off-by: John Millikin <[email protected]>
  • Loading branch information
jmillikin-stripe authored and mattklein123 committed Nov 7, 2017
1 parent d70404f commit c7bfe14
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 28 deletions.
1 change: 1 addition & 0 deletions bazel/external/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cc_library(
srcs = [":empty.cc"],
deps = [
"@com_github_lightstep_lightstep_tracer_cpp//:lightstep",
"@com_google_googletest//:gtest",
],
)

Expand Down
13 changes: 13 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion bazel/target_recipes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 0 additions & 14 deletions ci/build_container/build_recipes/googletest.sh

This file was deleted.

13 changes: 0 additions & 13 deletions ci/prebuilt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit c7bfe14

Please sign in to comment.