Merge pull request #8860 from tamird/more-warnings

Disallow minor warnings
pull/8859/head
Matt Fowles Kulukundis 4 years ago committed by GitHub
commit 7ab417fa49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 54
      BUILD

54
BUILD

@ -4,7 +4,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_python//python:defs.bzl", "py_library") load("@rules_python//python:defs.bzl", "py_library")
load("@rules_java//java:defs.bzl", "java_binary", "java_proto_library", "java_lite_proto_library") load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test")
licenses(["notice"]) licenses(["notice"])
@ -39,7 +39,6 @@ MSVC_COPTS = [
"/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) "/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
"/wd4355", # 'this' : used in base member initializer list "/wd4355", # 'this' : used in base member initializer list
"/wd4506", # no definition for inline function 'function' "/wd4506", # no definition for inline function 'function'
"/wd4514", # -Wno-unused-function
"/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning) "/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning)
"/wd4996", # The compiler encountered a deprecated declaration. "/wd4996", # The compiler encountered a deprecated declaration.
] ]
@ -51,10 +50,6 @@ COPTS = select({
"-DHAVE_ZLIB", "-DHAVE_ZLIB",
"-Woverloaded-virtual", "-Woverloaded-virtual",
"-Wno-sign-compare", "-Wno-sign-compare",
"-Wno-unused-function",
# Prevents ISO C++ const string assignment warnings for pyext sources.
"-Wno-write-strings",
"-Wno-deprecated-declarations",
], ],
}) })
@ -334,8 +329,8 @@ filegroup(
adapt_proto_library( adapt_proto_library(
name = "cc_wkt_protos_genproto", name = "cc_wkt_protos_genproto",
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
) )
cc_library( cc_library(
@ -366,13 +361,12 @@ cc_library(
[native_cc_proto_library( [native_cc_proto_library(
name = proto + "_cc_proto", name = proto + "_cc_proto",
deps = [proto + "_proto"],
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [proto + "_proto"],
) for proto in WELL_KNOWN_PROTO_MAP.keys()] ) for proto in WELL_KNOWN_PROTO_MAP.keys()]
cc_proto_blacklist_test( cc_proto_blacklist_test(
name = "cc_proto_blacklist_test", name = "cc_proto_blacklist_test",
deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
tags = [ tags = [
# Exclude this target from wildcard expansion (//...). Due to # Exclude this target from wildcard expansion (//...). Due to
# https://github.com/bazelbuild/bazel/issues/10590, this test has to # https://github.com/bazelbuild/bazel/issues/10590, this test has to
@ -381,6 +375,7 @@ cc_proto_blacklist_test(
# See also https://github.com/protocolbuffers/protobuf/pull/7096. # See also https://github.com/protocolbuffers/protobuf/pull/7096.
"manual", "manual",
], ],
deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
) )
################################################################################ ################################################################################
@ -496,8 +491,8 @@ cc_binary(
filegroup( filegroup(
name = "testdata", name = "testdata",
visibility = ["//:__subpackages__"],
srcs = glob(["src/google/protobuf/testdata/**/*"]), srcs = glob(["src/google/protobuf/testdata/**/*"]),
visibility = ["//:__subpackages__"],
) )
RELATIVE_LITE_TEST_PROTOS = [ RELATIVE_LITE_TEST_PROTOS = [
@ -594,9 +589,9 @@ GENERIC_TEST_PROTOS = ["src/" + s for s in GENERIC_RELATIVE_TEST_PROTOS]
proto_library( proto_library(
name = "generic_test_protos", name = "generic_test_protos",
visibility = ["//:__subpackages__"],
strip_import_prefix = "src",
srcs = LITE_TEST_PROTOS + GENERIC_TEST_PROTOS, srcs = LITE_TEST_PROTOS + GENERIC_TEST_PROTOS,
strip_import_prefix = "src",
visibility = ["//:__subpackages__"],
deps = [ deps = [
"//:any_proto", "//:any_proto",
"//:api_proto", "//:api_proto",
@ -744,7 +739,12 @@ cc_test(
], ],
":msvc": [], ":msvc": [],
}), }),
copts = COPTS, copts = COPTS + select({
":msvc": [],
"//conditions:default": [
"-Wno-deprecated-declarations",
],
}),
data = [ data = [
":test_plugin", ":test_plugin",
] + glob([ ] + glob([
@ -772,19 +772,19 @@ cc_test(
internal_gen_well_known_protos_java( internal_gen_well_known_protos_java(
name = "gen_well_known_protos_java", name = "gen_well_known_protos_java",
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
) )
internal_gen_well_known_protos_java( internal_gen_well_known_protos_java(
name = "gen_well_known_protos_javalite", name = "gen_well_known_protos_javalite",
deps = [proto + "_proto" for proto in LITE_WELL_KNOWN_PROTO_MAP.keys()],
javalite = True, javalite = True,
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
deps = [proto + "_proto" for proto in LITE_WELL_KNOWN_PROTO_MAP.keys()],
) )
alias( alias(
@ -842,6 +842,8 @@ cc_binary(
copts = COPTS + [ copts = COPTS + [
"-DPYTHON_PROTO2_CPP_IMPL_V2", "-DPYTHON_PROTO2_CPP_IMPL_V2",
], ],
linkshared = 1,
linkstatic = 1,
tags = [ tags = [
# Exclude this target from wildcard expansion (//...) because it may # Exclude this target from wildcard expansion (//...) because it may
# not even be buildable. It will be built if it is needed according # not even be buildable. It will be built if it is needed according
@ -849,8 +851,6 @@ cc_binary(
# https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
"manual", "manual",
], ],
linkshared = 1,
linkstatic = 1,
deps = select({ deps = select({
"//conditions:default": [], "//conditions:default": [],
":use_fast_cpp_protos": ["//external:python_headers"], ":use_fast_cpp_protos": ["//external:python_headers"],
@ -873,6 +873,8 @@ cc_binary(
"python/", "python/",
"src/", "src/",
], ],
linkshared = 1,
linkstatic = 1,
tags = [ tags = [
# Exclude this target from wildcard expansion (//...) because it may # Exclude this target from wildcard expansion (//...) because it may
# not even be buildable. It will be built if it is needed according # not even be buildable. It will be built if it is needed according
@ -880,8 +882,6 @@ cc_binary(
# https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
"manual", "manual",
], ],
linkshared = 1,
linkstatic = 1,
deps = [ deps = [
":protobuf", ":protobuf",
":proto_api", ":proto_api",
@ -1226,7 +1226,7 @@ java_proto_library(
name = "test_messages_proto3_java_proto", name = "test_messages_proto3_java_proto",
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
deps = [":test_messages_proto3_proto"], deps = [":test_messages_proto3_proto"],
) )
@ -1247,11 +1247,11 @@ java_lite_proto_library(
) )
java_lite_proto_library( java_lite_proto_library(
name = "conformance_java_proto_lite", name = "conformance_java_proto_lite",
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
deps = [":conformance_proto"], deps = [":conformance_proto"],
) )
java_lite_proto_library( java_lite_proto_library(
@ -1265,10 +1265,10 @@ java_lite_proto_library(
java_binary( java_binary(
name = "conformance_java", name = "conformance_java",
srcs = ["conformance/ConformanceJava.java"], srcs = ["conformance/ConformanceJava.java"],
main_class = "ConformanceJava",
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
main_class = "ConformanceJava",
deps = [ deps = [
":conformance_java_proto", ":conformance_java_proto",
":test_messages_proto2_java_proto", ":test_messages_proto2_java_proto",
@ -1281,16 +1281,16 @@ java_binary(
java_binary( java_binary(
name = "conformance_java_lite", name = "conformance_java_lite",
srcs = ["conformance/ConformanceJavaLite.java"], srcs = ["conformance/ConformanceJavaLite.java"],
main_class = "ConformanceJavaLite",
visibility = [ visibility = [
"//java:__subpackages__", "//java:__subpackages__",
], ],
main_class = "ConformanceJavaLite",
deps = [ deps = [
":conformance_java_proto_lite", ":conformance_java_proto_lite",
":test_messages_proto2_java_proto_lite", ":test_messages_proto2_java_proto_lite",
":test_messages_proto3_java_proto_lite", ":test_messages_proto3_java_proto_lite",
"//:protobuf_javalite",
"//:protobuf_java_util", "//:protobuf_java_util",
"//:protobuf_javalite",
], ],
) )

Loading…
Cancel
Save