Index: components/cronet/ios/BUILD.gn |
diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn |
index 716fa0b47ef7212d96362b7236a846d969a6b4b2..20b0bc08999ba41c9862078f1bf18d3c60350be2 100644 |
--- a/components/cronet/ios/BUILD.gn |
+++ b/components/cronet/ios/BUILD.gn |
@@ -73,6 +73,52 @@ tweak_info_plist("tweak_cronet_plist") { |
info_plist = "Info.plist" |
} |
+_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", |
+] |
+ |
+static_library("cronet_static") { |
+ deps = _deps |
+ |
+ visibility = [ ":*" ] |
+ |
+ 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 |
+ |
+ 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", |
+ ] |
+} |
+ |
ios_framework_bundle("cronet_framework") { |
output_name = "Cronet" |
info_plist_target = ":tweak_cronet_plist" |
@@ -137,6 +183,51 @@ action("generate_accept_languages") { |
] |
} |
+# A static library which contains all dependencies of :cronet_static. |
+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.
|
+ visibility = [ ":*" ] |
+ complete_static_lib = true |
+ deps = _deps |
kapishnikov
2017/05/17 16:02:48
Why don't we add "cronet_static" as the dependency
|
+} |
+ |
+config("cronet_config") { |
+ libs = [ |
+ "$target_out_dir/libcronet.a", |
+ "UIKit.Framework", |
+ "CFNetwork.framework", |
+ "MobileCoreServices.framework", |
+ "Security.framework", |
+ "SystemConfiguration.framework", |
+ "resolv", |
+ ] |
+} |
+ |
+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
|
+ script = "//components/cronet/tools/hide_symbols.py" |
+ deps = [ |
+ ":cronet_static", |
+ ":deps_complete", |
+ ] |
+ outputs = [ |
+ "$target_out_dir/libcronet.a", |
+ "$target_out_dir/libcronet.o", |
+ ] |
+ args = [ |
+ "--input_libs", |
+ rebase_path("$target_out_dir/libcronet_static.a", root_build_dir), |
+ "--deps_lib", |
+ rebase_path("$target_out_dir/libdeps_complete.a", root_build_dir), |
+ "--output_obj", |
+ rebase_path("$target_out_dir/libcronet.o", root_build_dir), |
+ "--output_lib", |
+ rebase_path("$target_out_dir/libcronet.a", root_build_dir), |
+ "--current_cpu", |
+ current_cpu, |
+ ] |
+ |
+ public_configs = [ ":cronet_config" ] |
+} |
+ |
if (additional_toolchains == [] || current_toolchain == default_toolchain) { |
_package_dir = "$root_out_dir/cronet" |
@@ -163,6 +254,7 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) { |
copy("cronet_package_copy") { |
sources = [ |
"$root_out_dir/Cronet.framework", |
+ "$target_out_dir/libcronet.a", |
"//AUTHORS", |
"//chrome/VERSION", |
] |
@@ -172,6 +264,7 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) { |
deps = [ |
":cronet_framework", |
+ ":lib_cronet", |
] |
} |