OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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/buildflag_header.gni") | 5 import("//build/buildflag_header.gni") |
6 import("//build/config/ios/rules.gni") | 6 import("//build/config/ios/rules.gni") |
7 import("//build/config/mac/symbols.gni") | 7 import("//build/config/mac/symbols.gni") |
8 import("//build/mac/tweak_info_plist.gni") | 8 import("//build/mac/tweak_info_plist.gni") |
9 import("//build/util/process_version.gni") | 9 import("//build/util/process_version.gni") |
10 import("//build/util/version.gni") | 10 import("//build/util/version.gni") |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 if (!use_platform_icu_alternatives) { | 66 if (!use_platform_icu_alternatives) { |
67 deps += [ "//base:i18n" ] | 67 deps += [ "//base:i18n" ] |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 # Tweak |info_plist| with current version and revision. | 71 # Tweak |info_plist| with current version and revision. |
72 tweak_info_plist("tweak_cronet_plist") { | 72 tweak_info_plist("tweak_cronet_plist") { |
73 info_plist = "Info.plist" | 73 info_plist = "Info.plist" |
74 } | 74 } |
75 | 75 |
76 _deps = [ | |
77 ":cronet_version_header", | |
78 ":generate_accept_languages", | |
79 "//base:base", | |
80 "//components/grpc_support", | |
81 "//components/metrics:metrics", | |
82 "//components/metrics/proto:proto", | |
83 "//components/prefs:prefs", | |
84 "//ios/net:net", | |
85 "//ios/web:user_agent", | |
86 "//net", | |
87 "//url", | |
88 ] | |
89 | |
90 static_library("cronet_static") { | |
91 deps = _deps | |
92 | |
93 visibility = [ ":*" ] | |
94 | |
95 include_dirs = [ "//components/grpc_support/include" ] | |
96 | |
97 public_deps = [ | |
98 "//components/grpc_support", | |
99 ] | |
100 | |
101 public_headers = [ | |
102 "Cronet.h", | |
103 "cronet_c_for_grpc.h", | |
104 ] | |
105 public_headers += grpc_public_headers | |
106 | |
107 sources = [ | |
108 "../histogram_manager.cc", | |
109 "../histogram_manager.h", | |
110 "../stale_host_resolver.cc", | |
111 "../stale_host_resolver.h", | |
112 "../url_request_context_config.cc", | |
113 "../url_request_context_config.h", | |
114 "Cronet.h", | |
115 "Cronet.mm", | |
116 "cronet_c_for_grpc.h", | |
117 "cronet_environment.h", | |
118 "cronet_environment.mm", | |
119 ] | |
120 } | |
121 | |
76 ios_framework_bundle("cronet_framework") { | 122 ios_framework_bundle("cronet_framework") { |
77 output_name = "Cronet" | 123 output_name = "Cronet" |
78 info_plist_target = ":tweak_cronet_plist" | 124 info_plist_target = ":tweak_cronet_plist" |
79 | 125 |
80 deps = [ | 126 deps = [ |
81 ":cronet_sources", | 127 ":cronet_sources", |
82 "//base", | 128 "//base", |
83 "//net:net", | 129 "//net:net", |
84 ] | 130 ] |
85 | 131 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 script = "//components/cronet/tools/generate_accept_languages.py" | 176 script = "//components/cronet/tools/generate_accept_languages.py" |
131 args = [ | 177 args = [ |
132 rebase_path("$target_gen_dir"), | 178 rebase_path("$target_gen_dir"), |
133 rebase_path("//"), | 179 rebase_path("//"), |
134 ] | 180 ] |
135 outputs = [ | 181 outputs = [ |
136 "$target_gen_dir/accept_languages_table.h", | 182 "$target_gen_dir/accept_languages_table.h", |
137 ] | 183 ] |
138 } | 184 } |
139 | 185 |
186 # A static library which contains all dependencies of :cronet_static. | |
187 static_library("deps_complete") { | |
kapishnikov
2017/05/17 16:02:49
Should we add "cronet_" prefix in front of the nam
mef
2017/05/19 18:07:58
Done.
| |
188 visibility = [ ":*" ] | |
189 complete_static_lib = true | |
190 deps = _deps | |
kapishnikov
2017/05/17 16:02:48
Why don't we add "cronet_static" as the dependency
| |
191 } | |
192 | |
193 config("cronet_config") { | |
194 libs = [ | |
195 "$target_out_dir/libcronet.a", | |
196 "UIKit.Framework", | |
197 "CFNetwork.framework", | |
198 "MobileCoreServices.framework", | |
199 "Security.framework", | |
200 "SystemConfiguration.framework", | |
201 "resolv", | |
202 ] | |
203 } | |
204 | |
205 action("lib_cronet") { | |
kapishnikov
2017/05/17 16:02:49
Is it possible to build a static iOS framework and
mef
2017/05/19 18:07:58
Yes, we should be able to do that. Next patch mayb
| |
206 script = "//components/cronet/tools/hide_symbols.py" | |
207 deps = [ | |
208 ":cronet_static", | |
209 ":deps_complete", | |
210 ] | |
211 outputs = [ | |
212 "$target_out_dir/libcronet.a", | |
213 "$target_out_dir/libcronet.o", | |
214 ] | |
215 args = [ | |
216 "--input_libs", | |
217 rebase_path("$target_out_dir/libcronet_static.a", root_build_dir), | |
218 "--deps_lib", | |
219 rebase_path("$target_out_dir/libdeps_complete.a", root_build_dir), | |
220 "--output_obj", | |
221 rebase_path("$target_out_dir/libcronet.o", root_build_dir), | |
222 "--output_lib", | |
223 rebase_path("$target_out_dir/libcronet.a", root_build_dir), | |
224 "--current_cpu", | |
225 current_cpu, | |
226 ] | |
227 | |
228 public_configs = [ ":cronet_config" ] | |
229 } | |
230 | |
140 if (additional_toolchains == [] || current_toolchain == default_toolchain) { | 231 if (additional_toolchains == [] || current_toolchain == default_toolchain) { |
141 _package_dir = "$root_out_dir/cronet" | 232 _package_dir = "$root_out_dir/cronet" |
142 | 233 |
143 action("generate_license") { | 234 action("generate_license") { |
144 _license_path = "$_package_dir/LICENSE" | 235 _license_path = "$_package_dir/LICENSE" |
145 | 236 |
146 script = "//components/cronet/tools/cronet_licenses.py" | 237 script = "//components/cronet/tools/cronet_licenses.py" |
147 inputs = [ | 238 inputs = [ |
148 "//build/util/LASTCHANGE", | 239 "//build/util/LASTCHANGE", |
149 "//buildtools/$host_os/gn", | 240 "//buildtools/$host_os/gn", |
150 ] | 241 ] |
151 outputs = [ | 242 outputs = [ |
152 _license_path, | 243 _license_path, |
153 ] | 244 ] |
154 args = [ | 245 args = [ |
155 "license", | 246 "license", |
156 rebase_path(_license_path, root_build_dir), | 247 rebase_path(_license_path, root_build_dir), |
157 "--gn", | 248 "--gn", |
158 "--gn-path", | 249 "--gn-path", |
159 rebase_path("//buildtools/$host_os/gn", root_build_dir), | 250 rebase_path("//buildtools/$host_os/gn", root_build_dir), |
160 ] | 251 ] |
161 } | 252 } |
162 | 253 |
163 copy("cronet_package_copy") { | 254 copy("cronet_package_copy") { |
164 sources = [ | 255 sources = [ |
165 "$root_out_dir/Cronet.framework", | 256 "$root_out_dir/Cronet.framework", |
257 "$target_out_dir/libcronet.a", | |
166 "//AUTHORS", | 258 "//AUTHORS", |
167 "//chrome/VERSION", | 259 "//chrome/VERSION", |
168 ] | 260 ] |
169 outputs = [ | 261 outputs = [ |
170 "$_package_dir/{{source_file_part}}", | 262 "$_package_dir/{{source_file_part}}", |
171 ] | 263 ] |
172 | 264 |
173 deps = [ | 265 deps = [ |
174 ":cronet_framework", | 266 ":cronet_framework", |
267 ":lib_cronet", | |
175 ] | 268 ] |
176 } | 269 } |
177 | 270 |
178 if (enable_dsyms) { | 271 if (enable_dsyms) { |
179 action("cronet_dsym_archive") { | 272 action("cronet_dsym_archive") { |
180 script = "//chrome/tools/build/mac/archive_symbols.py" | 273 script = "//chrome/tools/build/mac/archive_symbols.py" |
181 | 274 |
182 # These are the dSYMs that will be archived. The sources list must be | 275 # These are the dSYMs that will be archived. The sources list must be |
183 # the target outputs that correspond to the dSYMs (since a dSYM is a | 276 # the target outputs that correspond to the dSYMs (since a dSYM is a |
184 # directory it cannot be listed as a source file). The targets that | 277 # directory it cannot be listed as a source file). The targets that |
(...skipping 19 matching lines...) Expand all Loading... | |
204 } | 297 } |
205 } else { | 298 } else { |
206 group("cronet_dsym_archive") { | 299 group("cronet_dsym_archive") { |
207 } | 300 } |
208 } | 301 } |
209 | 302 |
210 group("cronet_package") { | 303 group("cronet_package") { |
211 deps = [ | 304 deps = [ |
212 ":cronet_dsym_archive", | 305 ":cronet_dsym_archive", |
213 ":cronet_package_copy", | 306 ":cronet_package_copy", |
214 ":generate_license", | 307 ":generate_license", |
kapishnikov
2017/05/17 16:02:48
Should the sample be part of the package? At least
| |
215 ] | 308 ] |
216 } | 309 } |
217 } | 310 } |
OLD | NEW |