| Index: components/cronet/ios/BUILD.gn
|
| diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn
|
| index 716fa0b47ef7212d96362b7236a846d969a6b4b2..17d171d7bc105bc76b67b1e7224e38916684f087 100644
|
| --- a/components/cronet/ios/BUILD.gn
|
| +++ b/components/cronet/ios/BUILD.gn
|
| @@ -32,34 +32,61 @@ process_version("cronet_version_header") {
|
| ]
|
| }
|
|
|
| -source_set("cronet_sources") {
|
| - deps = [
|
| - ":cronet_version_header",
|
| - ":generate_accept_languages",
|
| - "//base:base",
|
| - "//components/grpc_support",
|
| - "//components/metrics:metrics",
|
| - "//components/metrics/proto:proto",
|
| - "//components/prefs:prefs",
|
| - "//ios/net:net",
|
| - "//ios/web:user_agent",
|
| - "//net",
|
| - "//url",
|
| - ]
|
| +config("cronet_include_config") {
|
| + include_dirs = [ "//components/grpc_support/include" ]
|
| +}
|
|
|
| - sources = [
|
| - "../histogram_manager.cc",
|
| - "../histogram_manager.h",
|
| - "../stale_host_resolver.cc",
|
| - "../stale_host_resolver.h",
|
| - "../url_request_context_config.cc",
|
| - "../url_request_context_config.h",
|
| - "Cronet.h",
|
| - "Cronet.mm",
|
| - "cronet_c_for_grpc.h",
|
| - "cronet_environment.h",
|
| - "cronet_environment.mm",
|
| +config("cronet_static_config") {
|
| + libs = [
|
| + "CronetStatic.framework",
|
| + "UIKit.Framework",
|
| + "CFNetwork.framework",
|
| + "MobileCoreServices.framework",
|
| + "Security.framework",
|
| + "SystemConfiguration.framework",
|
| + "resolv",
|
| ]
|
| + configs = [ ":cronet_include_config" ]
|
| +}
|
| +
|
| +_cronet_deps = [
|
| + ":cronet_version_header",
|
| + ":generate_accept_languages",
|
| + "//base:base",
|
| + "//components/grpc_support",
|
| + "//components/metrics:metrics",
|
| + "//components/metrics/proto:proto",
|
| + "//components/prefs:prefs",
|
| + "//ios/net:net",
|
| + "//ios/web:user_agent",
|
| + "//net",
|
| + "//url",
|
| +]
|
| +
|
| +_cronet_sources = [
|
| + "../histogram_manager.cc",
|
| + "../histogram_manager.h",
|
| + "../stale_host_resolver.cc",
|
| + "../stale_host_resolver.h",
|
| + "../url_request_context_config.cc",
|
| + "../url_request_context_config.h",
|
| + "Cronet.h",
|
| + "Cronet.mm",
|
| + "cronet_c_for_grpc.h",
|
| + "cronet_environment.h",
|
| + "cronet_environment.mm",
|
| +]
|
| +
|
| +_cronet_public_headers = [
|
| + "Cronet.h",
|
| + "cronet_c_for_grpc.h",
|
| +]
|
| +_cronet_public_headers += grpc_public_headers
|
| +
|
| +source_set("cronet_sources") {
|
| + deps = _cronet_deps
|
| +
|
| + sources = _cronet_sources
|
|
|
| include_dirs = [ "//components/grpc_support/include" ]
|
|
|
| @@ -85,17 +112,11 @@ ios_framework_bundle("cronet_framework") {
|
|
|
| libs = [ "UIKit.Framework" ]
|
|
|
| - include_dirs = [ "//components/grpc_support/include" ]
|
| -
|
| public_deps = [
|
| "//components/grpc_support",
|
| ]
|
|
|
| - public_headers = [
|
| - "Cronet.h",
|
| - "cronet_c_for_grpc.h",
|
| - ]
|
| - public_headers += grpc_public_headers
|
| + public_headers = _cronet_public_headers
|
|
|
| sources = [
|
| "Cronet.h",
|
| @@ -103,6 +124,8 @@ ios_framework_bundle("cronet_framework") {
|
|
|
| configs -= [ "//build/config/compiler:default_symbols" ]
|
| configs += [ "//build/config/compiler:symbols" ]
|
| +
|
| + public_configs = [ ":cronet_include_config" ]
|
| }
|
|
|
| test("cronet_unittests") {
|
| @@ -137,6 +160,128 @@ action("generate_accept_languages") {
|
| ]
|
| }
|
|
|
| +# A static library which contains just _cronet_sources.
|
| +static_library("cronet_static") {
|
| + visibility = [ ":*" ]
|
| + deps = _cronet_deps
|
| + sources = _cronet_sources
|
| + public_configs = [ ":cronet_include_config" ]
|
| + public_deps = [
|
| + "//components/grpc_support",
|
| + ]
|
| +}
|
| +
|
| +# A static library which contains all dependencies of :cronet_static.
|
| +static_library("cronet_deps_complete") {
|
| + visibility = [ ":*" ]
|
| + complete_static_lib = true
|
| + deps = [
|
| + ":cronet_static",
|
| + ]
|
| +}
|
| +
|
| +# A static library which contains cronet and all dependendencies hidden inside.
|
| +action("cronet_static_complete") {
|
| + visibility = [ ":*" ]
|
| + script = "//components/cronet/tools/hide_symbols.py"
|
| + deps = [
|
| + ":cronet_deps_complete",
|
| + ":cronet_static",
|
| + ]
|
| + outputs = [
|
| + "$target_out_dir/$current_cpu/cronet_static_complete.a",
|
| + ]
|
| + args = [
|
| + "--input_libs",
|
| + rebase_path("$target_out_dir/libcronet_static.a", root_build_dir),
|
| + "--deps_lib",
|
| + rebase_path("$target_out_dir/libcronet_deps_complete.a", root_build_dir),
|
| + "--output_obj",
|
| + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.o",
|
| + root_build_dir),
|
| + "--output_lib",
|
| + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.a",
|
| + root_build_dir),
|
| + "--current_cpu",
|
| + current_cpu,
|
| + ]
|
| +
|
| + public_configs = [ ":cronet_static_config" ]
|
| +}
|
| +
|
| +# A fat static library which exports cronet public symbols and hides all dependendencies.
|
| +lipo_binary("libcronet") {
|
| + arch_binary_target = ":cronet_static_complete"
|
| + arch_binary_output = "cronet_static_complete.a"
|
| + output_name = "libcronet.a"
|
| + enable_stripping = false
|
| + enable_dsyms = false
|
| +}
|
| +
|
| +bundle_data("cronet_static_headers") {
|
| + sources = _cronet_public_headers
|
| + outputs = [
|
| + "{{bundle_root_dir}}/Headers/{{source_file_part}}",
|
| + ]
|
| +}
|
| +
|
| +bundle_data("cronet_static_binary") {
|
| + sources = get_target_outputs(":libcronet")
|
| + outputs = [
|
| + "{{bundle_root_dir}}/Cronet",
|
| + ]
|
| + public_deps = [
|
| + ":libcronet",
|
| + ]
|
| +}
|
| +
|
| +template("ios_static_framework") {
|
| + _target_name = target_name
|
| + _output_name = target_name
|
| + if (defined(invoker.output_name)) {
|
| + _output_name = invoker.output_name
|
| + }
|
| + _has_public_headers =
|
| + defined(invoker.public_headers) && invoker.public_headers != []
|
| + _has_public_headers = defined(public_headers) && public_headers != []
|
| +
|
| + #_default_toolchain_root_out_dir =
|
| + # get_label_info("$_target_name($default_toolchain)", "root_out_dir")
|
| +
|
| + if (_has_public_headers) {
|
| + _framework_headers_target = _target_name + "_framework_headers"
|
| + _framework_headers_config = _target_name + "_framework_headers_config"
|
| + config(_framework_headers_config) {
|
| + # The link settings are inherited from the framework_bundle config.
|
| + cflags = [
|
| + "-F",
|
| + rebase_path("$_default_toolchain_root_out_dir/.", root_build_dir),
|
| + ]
|
| + }
|
| +
|
| + _headers_map_config = _target_name + "_headers_map"
|
| + _header_map_filename =
|
| + "$_default_toolchain_target_gen_dir/$_output_name.headers.hmap"
|
| + config(_headers_map_config) {
|
| + visibility = [ ":$_target_name" ]
|
| + include_dirs = [ _header_map_filename ]
|
| + }
|
| + }
|
| +
|
| + create_bundle(_target_name) {
|
| + bundle_root_dir = "$root_out_dir/$_output_name"
|
| + deps = invoker.deps
|
| + }
|
| +}
|
| +
|
| +ios_static_framework("cronet_static_framework") {
|
| + output_name = "CronetStatic.framework"
|
| + deps = [
|
| + ":cronet_static_binary",
|
| + ":cronet_static_headers",
|
| + ]
|
| +}
|
| +
|
| if (additional_toolchains == [] || current_toolchain == default_toolchain) {
|
| _package_dir = "$root_out_dir/cronet"
|
|
|
| @@ -163,6 +308,8 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) {
|
| copy("cronet_package_copy") {
|
| sources = [
|
| "$root_out_dir/Cronet.framework",
|
| + "$root_out_dir/CronetStatic.framework",
|
| + "$target_out_dir/libcronet.a",
|
| "//AUTHORS",
|
| "//chrome/VERSION",
|
| ]
|
| @@ -172,6 +319,8 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) {
|
|
|
| deps = [
|
| ":cronet_framework",
|
| + ":cronet_static_framework",
|
| + ":libcronet",
|
| ]
|
| }
|
|
|
|
|