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/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
| 6 import("//build/config/mac/mac_sdk.gni") | 6 import("//build/config/mac/mac_sdk.gni") |
| 7 import("//build/config/mac/symbols.gni") | 7 import("//build/config/mac/symbols.gni") |
| 8 | 8 |
| 9 # This is included by reference in the //build/config/compiler config that | 9 # This is included by reference in the //build/config/compiler config that |
| 10 # is applied to all targets. It is here to separate out the logic. | 10 # is applied to all targets. It is here to separate out the logic. |
| 11 # | 11 # |
| 12 # This is applied to BOTH desktop Mac and iOS targets. | 12 # This is applied to BOTH desktop Mac and iOS targets. |
| 13 config("compiler") { | 13 config("compiler") { |
|
brettw
2016/07/18 19:27:51
If one always wants this, I'd put the new flag on
Robert Sesek
2016/07/18 19:38:48
Done.
| |
| 14 # These flags are shared between the C compiler and linker. | 14 # These flags are shared between the C compiler and linker. |
| 15 common_mac_flags = [] | 15 common_mac_flags = [] |
| 16 | 16 |
| 17 # CPU architecture. | 17 # CPU architecture. |
| 18 if (current_cpu == "x64") { | 18 if (current_cpu == "x64") { |
| 19 common_mac_flags += [ | 19 common_mac_flags += [ |
| 20 "-arch", | 20 "-arch", |
| 21 "x86_64", | 21 "x86_64", |
| 22 ] | 22 ] |
| 23 } else if (current_cpu == "x86") { | 23 } else if (current_cpu == "x86") { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 } | 91 } |
| 92 | 92 |
| 93 # On Mac, this is used only for executables. | 93 # On Mac, this is used only for executables. |
| 94 config("mac_executable_flags") { | 94 config("mac_executable_flags") { |
| 95 # Remove this when targeting >=10.7 since it is the default in that config. | 95 # Remove this when targeting >=10.7 since it is the default in that config. |
| 96 ldflags = [ "-Wl,-pie" ] # Position independent. | 96 ldflags = [ "-Wl,-pie" ] # Position independent. |
| 97 } | 97 } |
| 98 | 98 |
| 99 # The ldflags referenced below are handled by | 99 # The ldflags referenced below are handled by |
| 100 # //build/toolchain/mac/linker_driver.py. | 100 # //build/toolchain/mac/linker_driver.py. |
| 101 | |
| 101 # Remove this config if a target wishes to change the arguments passed to the | 102 # Remove this config if a target wishes to change the arguments passed to the |
| 102 # strip command during linking. This config by default strips all symbols | 103 # strip command during linking. This config by default strips all symbols |
| 103 # from a binary, but some targets may wish to specify a saves file to preserve | 104 # from a binary, but some targets may wish to specify a saves file to preserve |
| 104 # specific symbols. | 105 # specific symbols. |
| 105 config("strip_all") { | 106 config("strip_all") { |
| 106 if (enable_stripping) { | 107 if (enable_stripping) { |
| 107 ldflags = [ "-Wcrl,strip,-x,-S" ] | 108 ldflags = [ "-Wcrl,strip,-x,-S" ] |
| 108 } | 109 } |
| 109 } | 110 } |
| 111 | |
| 112 # This config will keep unstripped copies of the linker output. | |
| 113 config("save_unstripped_output") { | |
| 114 if (save_unstripped_output) { | |
| 115 ldflags = [ "-Wcrl,unstripped," + rebase_path(root_out_dir) ] | |
| 116 } | |
| 117 } | |
| OLD | NEW |