diff --git a/build_defs/cpp_opts.bzl b/build_defs/cpp_opts.bzl index d8646d1681fe6..f46b7dcc0a65c 100644 --- a/build_defs/cpp_opts.bzl +++ b/build_defs/cpp_opts.bzl @@ -17,10 +17,7 @@ COPTS = select({ "/wd4996", # The compiler encountered a deprecated declaration. ], "//conditions:default": [ - "-DHAVE_ZLIB", - "-Woverloaded-virtual", "-Wno-sign-compare", - "-Wno-nonnull", ], }) diff --git a/ci/Linux.bazelrc b/ci/Linux.bazelrc index b4ec98f8c7965..3cdf40d218441 100644 --- a/ci/Linux.bazelrc +++ b/ci/Linux.bazelrc @@ -1,4 +1,5 @@ import common.bazelrc build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 +build --cxxopt="-Woverloaded-virtual" build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations" diff --git a/ci/macOS.bazelrc b/ci/macOS.bazelrc index e426b59f5799b..e91f62639a2d6 100644 --- a/ci/macOS.bazelrc +++ b/ci/macOS.bazelrc @@ -1,6 +1,7 @@ import common.bazelrc build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 +build --cxxopt="-Woverloaded-virtual" build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations" common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 -common --xcode_version_config=@com_google_protobuf//.github:host_xcodes \ No newline at end of file +common --xcode_version_config=@com_google_protobuf//.github:host_xcodes diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel index 27c444480168d..eb865df5669c5 100644 --- a/src/google/protobuf/io/BUILD.bazel +++ b/src/google/protobuf/io/BUILD.bazel @@ -150,7 +150,10 @@ cc_library( name = "gzip_stream", srcs = ["gzip_stream.cc"], hdrs = ["gzip_stream.h"], - copts = COPTS, + copts = COPTS + select({ + "//build_defs:config_msvc": [], + "//conditions:default": ["-DHAVE_ZLIB"], + }), strip_include_prefix = "/src", deps = [ ":io", @@ -192,7 +195,10 @@ cc_test( "tokenizer_unittest.cc", "zero_copy_stream_unittest.cc", ], - copts = COPTS, + copts = COPTS + select({ + "//build_defs:config_msvc": [], + "//conditions:default": ["-DHAVE_ZLIB"], + }), deps = [ ":gzip_stream", ":io",