Enable deprecation warnings on deps of jsoncpp on iOS and macOS
jsoncpp adds -Wno-deprecated-declarations in a public_config,
pushing it to all its deps.
In general, -Wno warning flags should always be in configs,
very rarely in public_configs.
Enable the warning on iOS and mac now that things build with it
enabled. (This required quite a bit of cleanup, see bug.)
Also reorganize the file a bit to remove redundancy. This part
has no intentional behavior change.
https://chromium-review.googlesource.com/c/chromium/src/+/3424283
tried to do this on iOS, but I think it got the parentheses wrong
so that it didn't have an effect.
Bug: 983223
Change-Id: I45add2fa51f9ff5c2180ac81c571a70226cfbec0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4066799
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1077440}
NOKEYCHECK=True
GitOrigin-RevId: 282da71f6379aa6b263638d4f6e9f0dd2bffaea9
diff --git a/BUILD.gn b/BUILD.gn
index 7d8c75d..9da0763 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -7,19 +7,14 @@
declare_args() {
# Allow individual projects to remove the warning suppression
# by overriding this in their .gn file or through custom args.gn
- # See crbug.com/983223
- jsoncpp_no_deprecated_declarations = true
+ # TODO(crbug.com/983223): Set this to false on all platforms, then remove it.
+ jsoncpp_no_deprecated_declarations = !is_apple && (!is_win || is_clang)
}
config("jsoncpp_config") {
include_dirs = [ "source/include" ]
- # TODO(crbug.com/983223): Update JsonCpp BUILD.gn to remove deprecated
- # declaration flag.
- # This temporary flag allowing clients to update to the new version, and then
- # update to the new StreamWriter and CharReader classes.
- if (jsoncpp_no_deprecated_declarations &&
- (!is_win || (is_clang && !is_ios))) {
+ if (jsoncpp_no_deprecated_declarations) {
cflags_cc = [ "-Wno-deprecated-declarations" ]
}
}