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 if (is_ios) { | |
| 7 import("//build/config/ios/ios_sdk.gni") | |
| 8 } | |
| 9 import("//build/config/mac/mac_sdk.gni") | 6 import("//build/config/mac/mac_sdk.gni") |
| 10 import("//build/config/mac/symbols.gni") | 7 import("//build/config/mac/symbols.gni") |
| 11 | 8 |
| 9 if (is_ios) { | |
| 10 # This needs to be imported after mac_sdk.gni as it overrides some of the | |
| 11 # variables defined by it. | |
|
Dirk Pranke
2016/08/09 19:55:48
Told ya! :).
We should modify ios_sdk.gni to eith
| |
| 12 import("//build/config/ios/ios_sdk.gni") | |
| 13 } | |
| 14 | |
| 12 # This is included by reference in the //build/config/compiler config that | 15 # This is included by reference in the //build/config/compiler config that |
| 13 # is applied to all targets. It is here to separate out the logic. | 16 # is applied to all targets. It is here to separate out the logic. |
| 14 # | 17 # |
| 15 # This is applied to BOTH desktop Mac and iOS targets. | 18 # This is applied to BOTH desktop Mac and iOS targets. |
| 16 config("compiler") { | 19 config("compiler") { |
| 17 # These flags are shared between the C compiler and linker. | 20 # These flags are shared between the C compiler and linker. |
| 18 common_mac_flags = [] | 21 common_mac_flags = [] |
| 19 | 22 |
| 20 # CPU architecture. | 23 # CPU architecture. |
| 21 if (current_cpu == "x64") { | 24 if (current_cpu == "x64") { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 33 "-arch", | 36 "-arch", |
| 34 "armv7", | 37 "armv7", |
| 35 ] | 38 ] |
| 36 } else if (current_cpu == "arm64") { | 39 } else if (current_cpu == "arm64") { |
| 37 common_mac_flags += [ | 40 common_mac_flags += [ |
| 38 "-arch", | 41 "-arch", |
| 39 "arm64", | 42 "arm64", |
| 40 ] | 43 ] |
| 41 } | 44 } |
| 42 | 45 |
| 46 # This is here so that all files get recompiled after an Xcode update. | |
| 47 # (defines are passed via the command line, and build system rebuild things | |
| 48 # when their commandline changes). Nothing should ever read this define. | |
| 49 defines = [ "CR_XCODE_VERSION=$xcode_version" ] | |
| 50 | |
| 43 asmflags = common_mac_flags | 51 asmflags = common_mac_flags |
| 44 cflags = common_mac_flags | 52 cflags = common_mac_flags |
| 45 | 53 |
| 46 # Without this, the constructors and destructors of a C++ object inside | 54 # Without this, the constructors and destructors of a C++ object inside |
| 47 # an Objective C struct won't be called, which is very bad. | 55 # an Objective C struct won't be called, which is very bad. |
| 48 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] | 56 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] |
| 49 | 57 |
| 50 cflags_c = [ "-std=c99" ] | 58 cflags_c = [ "-std=c99" ] |
| 51 cflags_objc = cflags_c | 59 cflags_objc = cflags_c |
| 52 | 60 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 # from a binary, but some targets may wish to specify a saves file to preserve | 127 # from a binary, but some targets may wish to specify a saves file to preserve |
| 120 # specific symbols. | 128 # specific symbols. |
| 121 config("strip_all") { | 129 config("strip_all") { |
| 122 # On iOS, the final applications are assembled using lipo (to support fat | 130 # On iOS, the final applications are assembled using lipo (to support fat |
| 123 # builds). This configuration is thus always empty and the correct flags | 131 # builds). This configuration is thus always empty and the correct flags |
| 124 # are passed to the linker_driver.py script directly during the lipo call. | 132 # are passed to the linker_driver.py script directly during the lipo call. |
| 125 if (enable_stripping && !is_ios) { | 133 if (enable_stripping && !is_ios) { |
| 126 ldflags = [ "-Wcrl,strip,-x,-S" ] | 134 ldflags = [ "-Wcrl,strip,-x,-S" ] |
| 127 } | 135 } |
| 128 } | 136 } |
| OLD | NEW |