GN: Fix windows clang errors. Attempt 2.

BUG=webrtc:6255
NOTRY=True

Review-Url: https://codereview.webrtc.org/2281513002
Cr-Commit-Position: refs/heads/master@{#13942}
This commit is contained in:
ehmaldonado 2016-08-26 13:31:24 -07:00 committed by Commit bot
parent b4677de9b0
commit d02fe4b53b
11 changed files with 178 additions and 93 deletions

View File

@ -13,6 +13,29 @@ if (is_win) {
include_dirs = [ baseclasses_dir ]
}
config("winsdk_samples_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-comment",
"-Wno-delete-non-virtual-dtor",
"-Wno-ignored-attributes",
"-Wno-logical-op-parentheses",
"-Wno-non-pod-varargs",
"-Wno-microsoft-extra-qualification",
"-Wno-missing-braces",
"-Wno-overloaded-virtual",
"-Wno-parentheses",
"-Wno-reorder",
"-Wno-string-conversion",
"-Wno-tautological-constant-out-of-range-compare",
"-Wno-unused-private-field",
"-Wno-writable-strings",
]
}
}
static_library("winsdk_samples") {
sources = [
"$baseclasses_dir/amextra.cpp",
@ -84,26 +107,9 @@ if (is_win) {
"//build/config/compiler:chromium_code",
"//build/config/win:nominmax",
]
configs += [ "//build/config/compiler:no_chromium_code" ]
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-comment",
"-Wno-delete-non-virtual-dtor",
"-Wno-ignored-attributes",
"-Wno-logical-op-parentheses",
"-Wno-non-pod-varargs",
"-Wno-microsoft-extra-qualification",
"-Wno-missing-braces",
"-Wno-overloaded-virtual",
"-Wno-parentheses",
"-Wno-reorder",
"-Wno-string-conversion",
"-Wno-tautological-constant-out-of-range-compare",
"-Wno-unused-private-field",
"-Wno-writable-strings",
]
}
configs += [
"//build/config/compiler:no_chromium_code",
":winsdk_samples_warnings_config",
]
}
}

View File

@ -301,7 +301,12 @@ if (rtc_include_tests) {
# TODO(kjellander): Make the code compile without disabling these flags.
# See https://bugs.webrtc.org/3307.
if (is_clang && is_win) {
cflags = [ "-Wno-unused-function" ]
cflags = [
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
# for -Wno-sign-compare
"-Wno-sign-compare",
"-Wno-unused-function",
]
}
if (!is_win) {

View File

@ -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" ]
}
}
}

View File

@ -391,6 +391,21 @@ if (is_linux || is_win) {
}
}
config("peerconnection_client_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-format",
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
# for -Wno-reorder and -Wno-sign-compare
"-Wno-reorder",
"-Wno-sign-compare",
]
}
}
executable("peerconnection_client") {
sources = [
"peerconnection/client/conductor.cc",
@ -415,14 +430,6 @@ if (is_linux || is_win) {
cflags = [ "/wd4245" ]
configs += [ "//build/config/win:windowed" ]
}
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-reorder",
"-Wno-unused-function",
]
}
if (is_linux) {
sources += [
"peerconnection/client/linux/main.cc",
@ -443,6 +450,7 @@ if (is_linux || is_win) {
"//webrtc/system_wrappers:field_trial_default",
"//webrtc/system_wrappers:metrics_default",
]
configs += [ ":peerconnection_client_warnings_config" ]
if (rtc_build_json) {
deps += [ "//third_party/jsoncpp" ]
}

View File

@ -285,7 +285,12 @@ if (rtc_include_tests) {
# TODO(kjellander): Make the code compile without disabling these flags.
# See https://bugs.webrtc.org/3307.
if (is_clang && is_win) {
cflags = [ "-Wno-unused-function" ]
cflags = [
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6266
# for -Wno-sign-compare
"-Wno-sign-compare",
"-Wno-unused-function",
]
}
if (!is_win) {
cflags = [ "-Wno-sign-compare" ]

View File

@ -1537,6 +1537,16 @@ if (rtc_include_tests) {
}
}
config("isac_test_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-format",
]
}
}
executable("isac_test") {
testonly = true
@ -1557,13 +1567,7 @@ if (rtc_include_tests) {
"//build/config/sanitizers:deps",
]
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-format",
]
}
configs += [ ":isac_test_warnings_config" ]
}
executable("g711_test") {

View File

@ -24,7 +24,37 @@ config("audio_device_config") {
}
}
config("audio_device_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-bool-conversion",
"-Wno-delete-non-virtual-dtor",
"-Wno-logical-op-parentheses",
"-Wno-microsoft-extra-qualification",
"-Wno-microsoft-goto",
"-Wno-missing-braces",
"-Wno-parentheses-equality",
"-Wno-reorder",
"-Wno-shift-overflow",
"-Wno-tautological-compare",
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6265
# for -Wno-thread-safety-analysis
"-Wno-thread-safety-analysis",
"-Wno-unused-private-field",
]
}
}
source_set("audio_device") {
configs += [ "../..:common_config" ]
public_configs = [
"../..:common_inherited_config",
":audio_device_config",
]
deps = [
"../..:webrtc_common",
"../../base:rtc_base",
@ -193,23 +223,7 @@ source_set("audio_device") {
"msdmo.lib",
]
}
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-bool-conversion",
"-Wno-delete-non-virtual-dtor",
"-Wno-logical-op-parentheses",
"-Wno-microsoft-extra-qualification",
"-Wno-microsoft-goto",
"-Wno-missing-braces",
"-Wno-parentheses-equality",
"-Wno-reorder",
"-Wno-shift-overflow",
"-Wno-tautological-compare",
"-Wno-unused-private-field",
]
}
configs += [ ":audio_device_warnings_config" ]
}
} else {
defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
@ -223,12 +237,6 @@ source_set("audio_device") {
]
}
configs += [ "../..:common_config" ]
public_configs = [
"../..:common_inherited_config",
":audio_device_config",
]
if (is_clang) {
# Suppress warnings from Chrome's Clang plugins.
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.

View File

@ -76,7 +76,27 @@ if (!build_with_chromium) {
}
}
config("video_capture_internal_impl_warnings_config") {
if (is_win && is_clang) {
cflags = [
"-Wno-comment",
"-Wno-ignored-attributes",
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6269
# for -Wno-ignored-qualifiers
"-Wno-ignored-qualifiers",
"-Wno-microsoft-extra-qualification",
"-Wno-missing-braces",
"-Wno-overloaded-virtual",
"-Wno-reorder",
"-Wno-writable-strings",
]
}
}
source_set("video_capture_internal_impl") {
configs += [ ":video_capture_internal_impl_warnings_config" ]
deps = [
":video_capture_module",
"../../system_wrappers",
@ -136,17 +156,6 @@ if (!build_with_chromium) {
deps += [ "//third_party/winsdk_samples" ]
}
if (is_win && is_clang) {
cflags = [
"-Wno-comment",
"-Wno-ignored-attributes",
"-Wno-microsoft-extra-qualification",
"-Wno-missing-braces",
"-Wno-overloaded-virtual",
"-Wno-reorder",
"-Wno-writable-strings",
]
}
if (is_ios) {
sources = [
"ios/device_info_ios.h",

View File

@ -52,5 +52,11 @@ if (rtc_include_tests) {
if (is_android) {
deps += [ "//testing/android/native_test:native_test_native_code" ]
}
if (is_clang) {
# Suppress warnings from Chrome's Clang plugins.
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
}
}

View File

@ -133,6 +133,11 @@ source_set("system_wrappers") {
cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion.
}
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
deps += [ "../base:rtc_base_approved" ]
}

View File

@ -33,13 +33,17 @@ config("channel_transport_warnings_config") {
cflags = [ "/wd4302" ] # cast truncation
if (is_clang) {
# GN orders flags on a target before flags from configs. The default config
# adds -Wall, and this flag have to be after -Wall -- so they need to
# come from a config and cannot be on the target directly.
# GN orders flags on a target before flags from configs. The default
# config adds -Wall, and this flag have to be after -Wall -- so they need
# to come from a config and cannot be on the target directly.
cflags += [
"-Wno-parentheses-equality",
"-Wno-reorder",
"-Wno-tautological-constant-out-of-range-compare",
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
# for -Wno-thread-safety-analysis
"-Wno-thread-safety-analysis",
"-Wno-unused-private-field",
]
}