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

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

Issue 304453005: Turn on C++11 when building with gcc4.8+ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gnnnnnnnnn Created 6 years, 6 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 | « build/common.gypi ('k') | no next file » | 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 70f1fd2374c5dd5947a3acaafefd4ab57ea8d7d2..8bfa2341520f876d79409520f6d00562df5f8203 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -105,6 +105,11 @@ config("compiler") {
} else if (is_posix) {
# Non-Mac Posix compiler flags setup.
# -----------------------------------
+ if (gcc_version >= 48) {
+ cflags_cc += [
+ "-std=gnu++11",
+ ]
+ }
# CPU architecture. We may or may not be doing a cross compile now, so for
# simplicity we always explicitly set the architecture.
@@ -572,6 +577,7 @@ config("default_warnings") {
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
]
+ cflags_cc = []
if (is_mac) {
cflags += [
@@ -604,6 +610,20 @@ config("default_warnings") {
# Clang spots more unused functions.
"-Wno-unused-function",
]
+
+ if (!is_mac && !is_ios) {
+ cflags_cc += [
+ "-Wno-reserved-user-defined-literal",
+ ]
+ }
+ }
+ if (gcc_version >= 48) {
+ cflags_cc += [
+ # See comment for -Wno-c++11-narrowing.
+ "-Wno-narrowing",
+ # TODO(thakis): Remove, http://crbug.com/263960
+ "-Wno-literal-suffix",
+ ]
}
# Suppress warnings about ABI changes on ARM (Clang doesn't give this
@@ -621,7 +641,7 @@ config("default_warnings") {
"-Wno-ignored-qualifiers",
"-Wno-type-limits",
]
- cflags_cc = [
+ cflags_cc += [
# Disabling c++0x-compat should be handled in WebKit, but
# this currently doesn't work because gcc_version is not set
# correctly when building with the Android build system.
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698