Skip to content

Commit

Permalink
Merge pull request #8396 from Yannic/del-flag
Browse files Browse the repository at this point in the history
[bazel] Remove deprecated way to depend on googletest
  • Loading branch information
acozzette authored Mar 12, 2021
2 parents 80fe990 + a3aecac commit 50dd5b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 47 deletions.
44 changes: 9 additions & 35 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ exports_files(["LICENSE"])
# build configuration
################################################################################

# TODO(yannic): Remove in 3.14.0.
string_flag(
name = "incompatible_use_com_google_googletest",
build_setting_default = "true",
values = ["true", "false"]
)

config_setting(
name = "use_com_google_googletest",
flag_values = {
"//:incompatible_use_com_google_googletest": "true"
},
)

GTEST = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest",
],
"//conditions:default": [
"//external:gtest",
],
})

GTEST_MAIN = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest_main",
],
"//conditions:default": [
"//external:gtest_main",
],
})

################################################################################
# ZLIB configuration
################################################################################
Expand Down Expand Up @@ -571,6 +539,7 @@ COMMON_TEST_SRCS = [

cc_binary(
name = "test_plugin",
testonly = True,
srcs = [
# AUTOGEN(test_plugin_srcs)
"src/google/protobuf/compiler/mock_code_generator.cc",
Expand All @@ -580,7 +549,8 @@ cc_binary(
deps = [
":protobuf",
":protoc_lib",
] + GTEST,
"@com_google_googletest//:gtest",
],
)

cc_test(
Expand All @@ -592,7 +562,9 @@ cc_test(
],
deps = [
":protobuf_lite",
] + GTEST_MAIN,
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
Expand Down Expand Up @@ -695,7 +667,9 @@ cc_test(
":cc_test_protos",
":protobuf",
":protoc_lib",
] + PROTOBUF_DEPS + GTEST_MAIN,
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
] + PROTOBUF_DEPS,
)

################################################################################
Expand Down
12 changes: 0 additions & 12 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ bind(
actual = "//util/python:python_headers",
)

# TODO(yannic): Remove in 3.14.0.
bind(
name = "gtest",
actual = "@com_google_googletest//:gtest",
)

# TODO(yannic): Remove in 3.14.0.
bind(
name = "gtest_main",
actual = "@com_google_googletest//:gtest_main",
)

jvm_maven_import_external(
name = "guava_maven",
artifact = "com.google.guava:guava:18.0",
Expand Down

0 comments on commit 50dd5b9

Please sign in to comment.