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

Unified Diff: build/config/compiler/BUILD.gn

Issue 165873004: Make Linux GN build's cflags match GYP's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | build/config/linux/pkg-config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 7db12df3cfe6b78608f570f8603390fbf1378f49..595ee0d973d54e1960e909e0da61ce3c5b7be911 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -164,8 +164,10 @@ config("compiler") {
# https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
# Only apply this to the target linker, since the host
# linker might not be gold, but isn't used much anyway.
- "-Wl,--threads",
- "-Wl,--thread-count=4",
+ # TODO(raymes): Disable threading because gold is frequently
+ # crashing on the bots: crbug.com/161942.
+ #"-Wl,--threads",
+ #"-Wl,--thread-count=4",
]
}
@@ -397,29 +399,53 @@ config("chromium_code") {
}
}
config("no_chromium_code") {
+ cflags = []
+ cflags_cc = []
+ defines = []
+
if (is_win) {
- cflags = [
+ cflags += [
"/W3", # Warning level 3.
"/wd4800", # Disable warning when forcing value to bool.
]
- defines = [
+ defines += [
"_CRT_NONSTDC_NO_WARNINGS",
"_CRT_NONSTDC_NO_DEPRECATE",
]
}
+ if (is_linux) {
+ # Don't warn about ignoring the return value from e.g. close(). This is
+ # off by default in some gccs but on by default in others. BSD systems do
+ # not support this option, since they are usually using gcc 4.2.1, which
+ # does not have this flag yet.
+ cflags += [ "-Wno-unused-result" ]
+ }
+
+ if (is_linux || is_android) {
+ cflags += [
+ # Don't warn about printf format problems. This is off by default in gcc
+ # but on in Ubuntu's gcc(!).
+ "-Wno-format",
+ ]
+ cflags_cc += [
+ # Don't warn about hash_map in third-party code.
+ "-Wno-deprecated",
+ ]
+ }
+
if (is_android_webview_build) {
# There is a class of warning which:
# 1) Android always enables and also treats as errors
# 2) Chromium ignores in third party code
# So we re-enable those warnings when building Android.
- cflags = [
+ cflags += [
"-Wno-address",
"-Wno-format-security",
"-Wno-return-type",
"-Wno-sequence-point",
]
- cflags_cc = [ "-Wno-non-virtual-dtor" ]
+ cflags_cc += [ "-Wno-non-virtual-dtor" ]
}
}
@@ -488,7 +514,6 @@ config("default_warnings") {
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
- "-Wno-write-strings",
]
if (is_mac) {
« no previous file with comments | « no previous file | build/config/linux/pkg-config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698