Commit 548607f5 authored by Oleh Prypin's avatar Oleh Prypin Committed by Commit Bot

Add an override to use C++11

This is used for projects that rely on Chromium's build infrastructure
after Chromium switched to C++14
https://chromium-review.googlesource.com/c/583635

Bug: 750683
Change-Id: Id673a2474a1b5c606ce17b1ce8e7faa4de0cb5b9
Reviewed-on: https://chromium-review.googlesource.com/596870Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Oleh Prypin <oprypin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491195}
parent 9fd60dce
...@@ -104,6 +104,9 @@ declare_args() { ...@@ -104,6 +104,9 @@ declare_args() {
# on by default when goma is enabled because setting this to true may make # on by default when goma is enabled because setting this to true may make
# it harder to debug binaries. # it harder to debug binaries.
strip_absolute_paths_from_debug_symbols = false strip_absolute_paths_from_debug_symbols = false
# Allow projects that wish to stay on C++11 to override Chromium's default.
use_cxx11 = false
} }
if (is_clang && !is_nacl) { if (is_clang && !is_nacl) {
...@@ -457,14 +460,23 @@ config("compiler") { ...@@ -457,14 +460,23 @@ config("compiler") {
# TODO(thakis): Eventually switch this to c++11 instead, # TODO(thakis): Eventually switch this to c++11 instead,
# http://crbug.com/427584 # http://crbug.com/427584
cflags_c += [ "-std=gnu11" ] cflags_c += [ "-std=gnu11" ]
cflags_cc += [ "-std=gnu++14" ] if (use_cxx11) {
# Override Chromium's default for projects that wish to stay on C++11.
cflags_cc += [ "-std=gnu++11" ]
} else {
cflags_cc += [ "-std=gnu++14" ]
}
} else if (!is_win && !is_nacl) { } else if (!is_win && !is_nacl) {
# TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu11/gnu++11 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu11/gnu++11
# or c11/c++11; we technically don't need this toolchain any more, but there # or c11/c++11; we technically don't need this toolchain any more, but there
# are still a few buildbots using it, so until those are turned off # are still a few buildbots using it, so until those are turned off
# we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above.
cflags_c += [ "-std=c11" ] cflags_c += [ "-std=c11" ]
cflags_cc += [ "-std=c++14" ] if (use_cxx11) {
cflags_cc += [ "-std=c++11" ]
} else {
cflags_cc += [ "-std=c++14" ]
}
} }
if (is_mac) { if (is_mac) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment