Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: webrtc/base/BUILD.gn

Issue 2281513002: GN: Fix windows clang errors. Attempt 2. (Closed)
Patch Set: Revert mb_config.pyl. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/BUILD.gn ('k') | webrtc/examples/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/BUILD.gn
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 49bd66ae068a984f6d6d5ee9cfaea9a8842d6c33..a1748cadc4ab3005bac739ce852232632300ce49 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -236,6 +236,17 @@ static_library("rtc_task_queue") {
}
}
+config("rtc_base_warnings_config") {
+ if (is_win && is_clang) {
+ cflags = [
+ # Disable warnings failing when compiling with Clang on Windows.
+ # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
+ "-Wno-sign-compare",
+ "-Wno-missing-braces",
+ ]
+ }
+}
+
static_library("rtc_base") {
cflags = []
cflags_cc = []
@@ -260,7 +271,6 @@ static_library("rtc_base") {
]
all_dependent_configs = [ ":rtc_base_all_dependent_config" ]
-
defines = [ "LOGGING=1" ]
sources = [
@@ -405,6 +415,14 @@ static_library("rtc_base") {
"worker.h",
]
+ # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
+ # compiler settings.
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ if (!is_win) {
+ cflags += [ "-Wno-uninitialized" ]
+ }
+
if (build_with_chromium) {
if (is_win) {
sources += [ "../../webrtc_overrides/webrtc/base/win32socketinit.cc" ]
@@ -417,6 +435,7 @@ static_library("rtc_base") {
public_configs += [ ":rtc_base_chromium_config" ]
} else {
+ configs += [ ":rtc_base_warnings_config" ]
sources += [
"bandwidthsmoother.cc",
"bandwidthsmoother.h",
@@ -508,14 +527,6 @@ static_library("rtc_base") {
"win32socketserver.h",
]
}
- if (is_win && is_clang) {
- cflags += [
- # Disable warnings failing when compiling with Clang on Windows.
- # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
- "-Wno-sign-compare",
- "-Wno-missing-braces",
- ]
- }
if (rtc_build_json) {
deps += [ "//third_party/jsoncpp" ]
@@ -528,14 +539,6 @@ static_library("rtc_base") {
}
} # !build_with_chromium
- # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
- # compiler settings.
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
- if (!is_win) {
- cflags += [ "-Wno-uninitialized" ]
- }
-
if (rtc_build_ssl) {
deps += [ "//third_party/boringssl" ]
} else {
@@ -665,6 +668,10 @@ static_library("rtc_base") {
defines += [ "timezone=_timezone" ]
sources -= [ "ifaddrs_converter.cc" ]
}
+ if (is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ configs -= [ "//build/config/clang:find_bad_constructs" ]
+ }
}
source_set("gtest_prod") {
@@ -678,6 +685,16 @@ if (rtc_include_tests) {
defines = [ "GTEST_RELATIVE_PATH" ]
}
+ config("rtc_base_tests_utils_warnings_config") {
+ if (is_win && is_clang) {
+ cflags = [
+ # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270
+ "-Wno-reorder",
+ "-Wno-sign-compare",
+ ]
+ }
+ }
+
source_set("rtc_base_tests_utils") {
testonly = true
sources = [
@@ -696,7 +713,10 @@ if (rtc_include_tests) {
"timedelta.h",
"unittest_main.cc",
]
- configs += [ "..:common_config" ]
+ configs += [
+ "..:common_config",
+ ":rtc_base_tests_utils_warnings_config",
+ ]
public_configs = [
"..:common_inherited_config",
":rtc_base_tests_utils_exported_config",
@@ -709,6 +729,11 @@ if (rtc_include_tests) {
public_deps = [
"//testing/gtest",
]
+
+ if (is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ configs -= [ "//build/config/clang:find_bad_constructs" ]
+ }
}
}
« no previous file with comments | « webrtc/api/BUILD.gn ('k') | webrtc/examples/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698