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 14 matching lines...) Expand all Loading... |
25 sources = [ | 25 sources = [ |
26 "//chrome/VERSION", | 26 "//chrome/VERSION", |
27 ] | 27 ] |
28 output = "$target_gen_dir/version.h" | 28 output = "$target_gen_dir/version.h" |
29 extra_args = [ | 29 extra_args = [ |
30 "-e", | 30 "-e", |
31 "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)", | 31 "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)", |
32 ] | 32 ] |
33 } | 33 } |
34 | 34 |
| 35 _cronet_deps = [ |
| 36 ":cronet_version_header", |
| 37 ":generate_accept_languages", |
| 38 "//base:base", |
| 39 "//components/grpc_support", |
| 40 "//components/metrics:metrics", |
| 41 "//components/metrics/proto:proto", |
| 42 "//components/prefs:prefs", |
| 43 "//ios/net:net", |
| 44 "//ios/web:user_agent", |
| 45 "//net", |
| 46 "//url", |
| 47 ] |
| 48 |
| 49 _cronet_sources = [ |
| 50 "../histogram_manager.cc", |
| 51 "../histogram_manager.h", |
| 52 "../stale_host_resolver.cc", |
| 53 "../stale_host_resolver.h", |
| 54 "../url_request_context_config.cc", |
| 55 "../url_request_context_config.h", |
| 56 "Cronet.h", |
| 57 "Cronet.mm", |
| 58 "cronet_c_for_grpc.h", |
| 59 "cronet_environment.h", |
| 60 "cronet_environment.mm", |
| 61 ] |
| 62 |
35 source_set("cronet_sources") { | 63 source_set("cronet_sources") { |
36 deps = [ | 64 deps = _cronet_deps |
37 ":cronet_version_header", | |
38 ":generate_accept_languages", | |
39 "//base:base", | |
40 "//components/grpc_support", | |
41 "//components/metrics:metrics", | |
42 "//components/metrics/proto:proto", | |
43 "//components/prefs:prefs", | |
44 "//ios/net:net", | |
45 "//ios/web:user_agent", | |
46 "//net", | |
47 "//url", | |
48 ] | |
49 | 65 |
50 sources = [ | 66 sources = _cronet_sources |
51 "../histogram_manager.cc", | |
52 "../histogram_manager.h", | |
53 "../stale_host_resolver.cc", | |
54 "../stale_host_resolver.h", | |
55 "../url_request_context_config.cc", | |
56 "../url_request_context_config.h", | |
57 "Cronet.h", | |
58 "Cronet.mm", | |
59 "cronet_c_for_grpc.h", | |
60 "cronet_environment.h", | |
61 "cronet_environment.mm", | |
62 ] | |
63 | 67 |
64 include_dirs = [ "//components/grpc_support/include" ] | 68 include_dirs = [ "//components/grpc_support/include" ] |
65 | 69 |
66 if (!use_platform_icu_alternatives) { | 70 if (!use_platform_icu_alternatives) { |
67 deps += [ "//base:i18n" ] | 71 deps += [ "//base:i18n" ] |
68 } | 72 } |
69 } | 73 } |
70 | 74 |
71 # Tweak |info_plist| with current version and revision. | 75 # Tweak |info_plist| with current version and revision. |
72 tweak_info_plist("tweak_cronet_plist") { | 76 tweak_info_plist("tweak_cronet_plist") { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 script = "//components/cronet/tools/generate_accept_languages.py" | 134 script = "//components/cronet/tools/generate_accept_languages.py" |
131 args = [ | 135 args = [ |
132 rebase_path("$target_gen_dir"), | 136 rebase_path("$target_gen_dir"), |
133 rebase_path("//"), | 137 rebase_path("//"), |
134 ] | 138 ] |
135 outputs = [ | 139 outputs = [ |
136 "$target_gen_dir/accept_languages_table.h", | 140 "$target_gen_dir/accept_languages_table.h", |
137 ] | 141 ] |
138 } | 142 } |
139 | 143 |
| 144 # A static library which contains just _cronet_sources. |
| 145 static_library("cronet_static") { |
| 146 deps = _cronet_deps |
| 147 |
| 148 sources = _cronet_sources |
| 149 |
| 150 visibility = [ ":*" ] |
| 151 |
| 152 include_dirs = [ "//components/grpc_support/include" ] |
| 153 |
| 154 public_deps = [ |
| 155 "//components/grpc_support", |
| 156 ] |
| 157 |
| 158 public_headers = [ |
| 159 "Cronet.h", |
| 160 "cronet_c_for_grpc.h", |
| 161 ] |
| 162 public_headers += grpc_public_headers |
| 163 } |
| 164 |
| 165 # A static library which contains all dependencies of :cronet_static. |
| 166 static_library("cronet_deps_complete") { |
| 167 visibility = [ ":*" ] |
| 168 complete_static_lib = true |
| 169 deps = [ |
| 170 ":cronet_static", |
| 171 ] |
| 172 } |
| 173 |
| 174 # A static library which contains cronet and all dependendencies hidden inside. |
| 175 action("cronet_hide") { |
| 176 script = "//components/cronet/tools/hide_symbols.py" |
| 177 deps = [ |
| 178 ":cronet_deps_complete", |
| 179 ":cronet_static", |
| 180 ] |
| 181 outputs = [ |
| 182 "$target_out_dir/$current_cpu/libcronet_hide.a", |
| 183 ] |
| 184 args = [ |
| 185 "--input_libs", |
| 186 rebase_path("$target_out_dir/libcronet_static.a", root_build_dir), |
| 187 "--deps_lib", |
| 188 rebase_path("$target_out_dir/libcronet_deps_complete.a", root_build_dir), |
| 189 "--output_obj", |
| 190 rebase_path("$target_out_dir/$current_cpu/libcronet_hide.o", |
| 191 root_build_dir), |
| 192 "--output_lib", |
| 193 rebase_path("$target_out_dir/$current_cpu/libcronet_hide.a", |
| 194 root_build_dir), |
| 195 "--current_cpu", |
| 196 current_cpu, |
| 197 ] |
| 198 } |
| 199 |
| 200 # A fat static library which exports cronet public symbols and hides all depende
ndencies. |
| 201 lipo_binary("libcronet") { |
| 202 arch_binary_target = ":cronet_hide" |
| 203 arch_binary_output = "libcronet_hide.a" |
| 204 output_name = "libcronet.a" |
| 205 enable_stripping = false |
| 206 enable_dsyms = false |
| 207 } |
| 208 |
140 if (additional_toolchains == [] || current_toolchain == default_toolchain) { | 209 if (additional_toolchains == [] || current_toolchain == default_toolchain) { |
141 _package_dir = "$root_out_dir/cronet" | 210 _package_dir = "$root_out_dir/cronet" |
142 | 211 |
143 action("generate_license") { | 212 action("generate_license") { |
144 _license_path = "$_package_dir/LICENSE" | 213 _license_path = "$_package_dir/LICENSE" |
145 | 214 |
146 script = "//components/cronet/tools/cronet_licenses.py" | 215 script = "//components/cronet/tools/cronet_licenses.py" |
147 inputs = [ | 216 inputs = [ |
148 "//build/util/LASTCHANGE", | 217 "//build/util/LASTCHANGE", |
149 "//buildtools/$host_os/gn", | 218 "//buildtools/$host_os/gn", |
150 ] | 219 ] |
151 outputs = [ | 220 outputs = [ |
152 _license_path, | 221 _license_path, |
153 ] | 222 ] |
154 args = [ | 223 args = [ |
155 "license", | 224 "license", |
156 rebase_path(_license_path, root_build_dir), | 225 rebase_path(_license_path, root_build_dir), |
157 "--gn", | 226 "--gn", |
158 "--gn-path", | 227 "--gn-path", |
159 rebase_path("//buildtools/$host_os/gn", root_build_dir), | 228 rebase_path("//buildtools/$host_os/gn", root_build_dir), |
160 ] | 229 ] |
161 } | 230 } |
162 | 231 |
163 copy("cronet_package_copy") { | 232 copy("cronet_package_copy") { |
164 sources = [ | 233 sources = [ |
165 "$root_out_dir/Cronet.framework", | 234 "$root_out_dir/Cronet.framework", |
| 235 "$target_out_dir/libcronet.a", |
166 "//AUTHORS", | 236 "//AUTHORS", |
167 "//chrome/VERSION", | 237 "//chrome/VERSION", |
168 ] | 238 ] |
169 outputs = [ | 239 outputs = [ |
170 "$_package_dir/{{source_file_part}}", | 240 "$_package_dir/{{source_file_part}}", |
171 ] | 241 ] |
172 | 242 |
173 deps = [ | 243 deps = [ |
174 ":cronet_framework", | 244 ":cronet_framework", |
| 245 ":libcronet", |
175 ] | 246 ] |
176 } | 247 } |
177 | 248 |
178 if (enable_dsyms) { | 249 if (enable_dsyms) { |
179 action("cronet_dsym_archive") { | 250 action("cronet_dsym_archive") { |
180 script = "//chrome/tools/build/mac/archive_symbols.py" | 251 script = "//chrome/tools/build/mac/archive_symbols.py" |
181 | 252 |
182 # These are the dSYMs that will be archived. The sources list must be | 253 # 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 | 254 # 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 | 255 # directory it cannot be listed as a source file). The targets that |
(...skipping 23 matching lines...) Expand all Loading... |
208 } | 279 } |
209 | 280 |
210 group("cronet_package") { | 281 group("cronet_package") { |
211 deps = [ | 282 deps = [ |
212 ":cronet_dsym_archive", | 283 ":cronet_dsym_archive", |
213 ":cronet_package_copy", | 284 ":cronet_package_copy", |
214 ":generate_license", | 285 ":generate_license", |
215 ] | 286 ] |
216 } | 287 } |
217 } | 288 } |
OLD | NEW |