OLD | NEW |
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 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 cflags_cc += [ "-std=gnu++11" ] | 397 cflags_cc += [ "-std=gnu++11" ] |
398 } else if (!is_win && !is_nacl) { | 398 } else if (!is_win && !is_nacl) { |
399 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 | 399 # TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11 |
400 # or c++11; we technically don't need this toolchain any more, but there | 400 # or c++11; we technically don't need this toolchain any more, but there |
401 # are still a few buildbots using it, so until those are turned off | 401 # are still a few buildbots using it, so until those are turned off |
402 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. | 402 # we need the !is_nacl clause and the (is_nacl && is_clang) clause, above. |
403 cflags_cc += [ "-std=c++11" ] | 403 cflags_cc += [ "-std=c++11" ] |
404 } | 404 } |
405 | 405 |
406 if (is_mac) { | 406 if (is_mac) { |
407 # Tell the compiler to use libc++'s headers and the linker to link | |
408 # against libc++. The latter part normally requires OS X 10.7, | |
409 # but we still support running on 10.6. How does this work? Two | |
410 # parts: | |
411 # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6 | |
412 # combined with -stdlib=libc++ (it normally silently produced a | |
413 # binary that doesn't run on 10.6) | |
414 # 2. Further down, library_dirs is set to | |
415 # third_party/libc++-static, which contains a static | |
416 # libc++.a library. The linker then links against that instead | |
417 # of against /usr/lib/libc++.dylib when it sees the -lc++ flag | |
418 # added by the driver. | |
419 # | |
420 # In component builds, just link to the system libc++. This has | |
421 # the effect of making everything depend on libc++, which means | |
422 # component-build binaries won't run on 10.6 (no libc++ there), | |
423 # but for a developer-only configuration that's ok. (We don't | |
424 # want to raise the deployment target yet so that official and | |
425 # dev builds have the same deployment target. This affects | |
426 # things like which functions are considered deprecated.) | |
427 cflags_cc += [ "-stdlib=libc++" ] | 407 cflags_cc += [ "-stdlib=libc++" ] |
428 ldflags += [ "-stdlib=libc++" ] | 408 ldflags += [ "-stdlib=libc++" ] |
429 if (!is_component_build && !is_asan) { | |
430 ldflags += [ | |
431 "-L", | |
432 rebase_path("//third_party/libc++-static", root_build_dir), | |
433 ] | |
434 } | |
435 } | 409 } |
436 | 410 |
437 # Add flags for link-time optimization. These flags enable | 411 # Add flags for link-time optimization. These flags enable |
438 # optimizations/transformations that require whole-program visibility at link | 412 # optimizations/transformations that require whole-program visibility at link |
439 # time, so they need to be applied to all translation units, and we may end up | 413 # time, so they need to be applied to all translation units, and we may end up |
440 # with miscompiles if only part of the program is compiled with LTO flags. For | 414 # with miscompiles if only part of the program is compiled with LTO flags. For |
441 # that reason, we cannot allow targets to enable or disable these flags, for | 415 # that reason, we cannot allow targets to enable or disable these flags, for |
442 # example by disabling the optimize configuration. | 416 # example by disabling the optimize configuration. |
443 # TODO(pcc): Make this conditional on is_official_build rather than on gn | 417 # TODO(pcc): Make this conditional on is_official_build rather than on gn |
444 # flags for specific features. | 418 # flags for specific features. |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 | 1585 |
1612 if (is_ios || is_mac) { | 1586 if (is_ios || is_mac) { |
1613 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1587 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1614 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1588 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1615 config("enable_arc") { | 1589 config("enable_arc") { |
1616 common_flags = [ "-fobjc-arc" ] | 1590 common_flags = [ "-fobjc-arc" ] |
1617 cflags_objc = common_flags | 1591 cflags_objc = common_flags |
1618 cflags_objcc = common_flags | 1592 cflags_objcc = common_flags |
1619 } | 1593 } |
1620 } | 1594 } |
OLD | NEW |