Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: components/cronet/ios/cronet_consumer/BUILD.gn

Issue 2807283002: [Cronet] Build static libcronet.a for iOS with complete dependencies. (Closed)
Patch Set: Disable cronet_consumer_static target for fat builds. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/ios/cronet_consumer/BUILD.gn
diff --git a/components/cronet/ios/cronet_consumer/BUILD.gn b/components/cronet/ios/cronet_consumer/BUILD.gn
index 966057c455dd82796d8516e7b42c88d115dac48c..ea1be9030a4da65b8a957a686e147c10f6c2124b 100644
--- a/components/cronet/ios/cronet_consumer/BUILD.gn
+++ b/components/cronet/ios/cronet_consumer/BUILD.gn
@@ -3,28 +3,63 @@
# found in the LICENSE file.
import("//build/config/ios/rules.gni")
+import("//ios/features.gni")
-ios_app_bundle("cronet_consumer") {
- info_plist = "cronet-consumer-Info.plist"
+template("cronet_consumer_template") {
+ _target_name = target_name
+ ios_app_bundle(_target_name) {
+ info_plist = "cronet-consumer-Info.plist"
+
+ deps = [
+ "//base:base",
+ ]
+
+ deps += invoker.deps
+
+ sources = [
+ "cronet_consumer_app_delegate.h",
+ "cronet_consumer_app_delegate.mm",
+ "cronet_consumer_view_controller.h",
+ "cronet_consumer_view_controller.m",
+ "main.mm",
+ ]
+
+ forward_variables_from(invoker,
+ [
+ "bundle_deps",
+ "cflags",
+ "ldflags",
+ ])
+
+ configs += [ "//build/config/compiler:enable_arc" ]
+ }
+}
+
+cronet_consumer_template("cronet_consumer") {
deps = [
- "//base:base",
"//components/cronet/ios:cronet_framework+link",
-
- # All shared libraries must have the sanitizer deps to properly link in
- # asan mode (this target will be empty in other cases).
- "//build/config:exe_and_shlib_deps",
]
+ bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ]
+}
- sources = [
- "cronet_consumer_app_delegate.h",
- "cronet_consumer_app_delegate.mm",
- "cronet_consumer_view_controller.h",
- "cronet_consumer_view_controller.m",
- "main.mm",
- ]
+# TODO(mef): Building "cronet_consumer_static" app with additional_target_cpus
+# causes "cronet_static_framework" to build lipo_binary("libcronet") for
+# duplicate architecture (e.g. arm64+arm64) and breaks the build.
+if (!defined(additional_target_cpus)) {
+ cronet_consumer_template("cronet_consumer_static") {
+ deps = [
+ "//components/cronet/ios:cronet_static_framework",
+ ]
- bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ]
+ cflags = [
mef 2017/06/02 16:26:17 What's a better way to add $root_out_dir/Static to
+ "-F",
+ "Static",
+ ]
- configs += [ "//build/config/compiler:enable_arc" ]
+ ldflags = [
+ "-F",
+ "Static",
+ ]
+ }
}

Powered by Google App Engine
This is Rietveld 408576698