Chromium Code Reviews| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 # http://crbug.com/427584 | 396 # http://crbug.com/427584 |
| 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) { | |
| 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++" ] | |
|
Mark Mentovai
2016/09/12 18:33:26
We still need -stdlib, until we finally get our de
| |
| 428 ldflags += [ "-stdlib=libc++" ] | |
| 429 if (!is_component_build && !is_asan) { | |
|
Mark Mentovai
2016/09/12 18:33:26
But this stuff, and the long comment in this block
| |
| 430 ldflags += [ | |
| 431 "-L", | |
| 432 rebase_path("//third_party/libc++-static", root_build_dir), | |
| 433 ] | |
| 434 } | |
| 435 } | |
| 436 | |
| 437 # Add flags for link-time optimization. These flags enable | 406 # Add flags for link-time optimization. These flags enable |
| 438 # optimizations/transformations that require whole-program visibility at link | 407 # 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 | 408 # 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 | 409 # 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 | 410 # that reason, we cannot allow targets to enable or disable these flags, for |
| 442 # example by disabling the optimize configuration. | 411 # example by disabling the optimize configuration. |
| 443 # TODO(pcc): Make this conditional on is_official_build rather than on gn | 412 # TODO(pcc): Make this conditional on is_official_build rather than on gn |
| 444 # flags for specific features. | 413 # flags for specific features. |
| 445 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) { | 414 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) { |
| 446 cflags += [ "-flto" ] | 415 cflags += [ "-flto" ] |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1600 | 1569 |
| 1601 if (is_ios || is_mac) { | 1570 if (is_ios || is_mac) { |
| 1602 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1571 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1603 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1572 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1604 config("enable_arc") { | 1573 config("enable_arc") { |
| 1605 common_flags = [ "-fobjc-arc" ] | 1574 common_flags = [ "-fobjc-arc" ] |
| 1606 cflags_objc = common_flags | 1575 cflags_objc = common_flags |
| 1607 cflags_objcc = common_flags | 1576 cflags_objcc = common_flags |
| 1608 } | 1577 } |
| 1609 } | 1578 } |
| OLD | NEW |