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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1083963002: Remove duplicate -std=gnu++11 flag for Mac gn build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try using gnu++11 for android and nacl builds Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 if (current_cpu == "arm") { 6 if (current_cpu == "arm") {
7 import("//build/config/arm.gni") 7 import("//build/config/arm.gni")
8 } 8 }
9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") {
10 import("//build/config/mips.gni") 10 import("//build/config/mips.gni")
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 ] 187 ]
188 } 188 }
189 189
190 cflags += common_mac_flags 190 cflags += common_mac_flags
191 191
192 # Without this, the constructors and destructors of a C++ object inside 192 # Without this, the constructors and destructors of a C++ object inside
193 # an Objective C struct won't be called, which is very bad. 193 # an Objective C struct won't be called, which is very bad.
194 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] 194 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ]
195 195
196 cflags_c += [ "-std=c99" ] 196 cflags_c += [ "-std=c99" ]
197 cflags_cc += [ "-std=gnu++11" ]
198 197
199 ldflags += common_mac_flags 198 ldflags += common_mac_flags
200 } else if (is_posix) { 199 } else if (is_posix) {
201 # Non-Mac Posix compiler flags setup. 200 # Non-Mac Posix compiler flags setup.
202 # ----------------------------------- 201 # -----------------------------------
203 if (gcc_version >= 48) {
204 cflags_cc += [ "-std=gnu++11" ]
205 }
206
207 if (enable_profiling && !is_debug) { 202 if (enable_profiling && !is_debug) {
208 # The GYP build spams this define into every compilation unit, as we do 203 # The GYP build spams this define into every compilation unit, as we do
209 # here, but it only appears to be used in base and a couple other places. 204 # here, but it only appears to be used in base and a couple other places.
210 # TODO(abarth): Should we move this define closer to where it's used? 205 # TODO(abarth): Should we move this define closer to where it's used?
211 defines += [ "ENABLE_PROFILING" ] 206 defines += [ "ENABLE_PROFILING" ]
212 207
213 cflags += [ 208 cflags += [
214 "-fno-omit-frame-pointer", 209 "-fno-omit-frame-pointer",
215 "-g", 210 "-g",
216 ] 211 ]
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (linux_use_bundled_binutils) { 401 if (linux_use_bundled_binutils) {
407 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", 402 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
408 root_build_dir) 403 root_build_dir)
409 cflags += [ "-B$binutils_path" ] 404 cflags += [ "-B$binutils_path" ]
410 } 405 }
411 406
412 # Clang-specific compiler flags setup. 407 # Clang-specific compiler flags setup.
413 # ------------------------------------ 408 # ------------------------------------
414 if (is_clang) { 409 if (is_clang) {
415 cflags += [ "-fcolor-diagnostics" ] 410 cflags += [ "-fcolor-diagnostics" ]
411 }
412
413 # C++11 compiler flags setup.
414 # ---------------------------
415 if (is_linux || is_android || is_nacl) {
416 # gnu++11 instead of c++11 is needed because some code uses typeof() (a
417 # GNU extension).
418 # TODO(thakis): Eventually switch this to c++11 instead,
419 # http://crbug.com/427584
416 cflags_cc += [ "-std=gnu++11" ] 420 cflags_cc += [ "-std=gnu++11" ]
421 } else if (!is_win) {
422 cflags_cc += [ "-std=c++11" ]
417 } 423 }
418 424
419 # Android-specific flags setup. 425 # Android-specific flags setup.
420 # ----------------------------- 426 # -----------------------------
421 if (is_android) { 427 if (is_android) {
422 cflags += [ 428 cflags += [
423 "-ffunction-sections", 429 "-ffunction-sections",
424 "-funwind-tables", 430 "-funwind-tables",
425 "-fno-short-enums", 431 "-fno-short-enums",
426 ] 432 ]
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 cflags += [ "-gsplit-dwarf" ] 1087 cflags += [ "-gsplit-dwarf" ]
1082 } 1088 }
1083 } 1089 }
1084 } 1090 }
1085 1091
1086 config("no_symbols") { 1092 config("no_symbols") {
1087 if (!is_win) { 1093 if (!is_win) {
1088 cflags = [ "-g0" ] 1094 cflags = [ "-g0" ]
1089 } 1095 }
1090 } 1096 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698