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

Unified Diff: build/config/ios/rules.gni

Issue 1910133002: [iOS/Mac/GN] The framework_bundle template should not force dependencies to link it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « no previous file | build/config/mac/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/rules.gni
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni
index 5d5e2733ad2adea26209678c6c26786a46f973f7..7d50dba3b790a55dd208235ef608dcb0b908d69f 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -222,6 +222,13 @@ template("bundle_data_xib") {
# Template to package a shared library into an iOS framework bundle.
#
+# This template provides two targets to control whether the framework is
+# merely built when targets depend on it, or whether it is linked as well:
+# "$target_name" and "$target_name+link".
+#
+# See the //build/config/mac/rules.gni:framework_bundle for a discussion
+# and examples.
+#
# Arguments
#
# output_name:
@@ -332,6 +339,18 @@ template("ios_framework_bundle") {
}
}
+ _framework_public_config = _target_name + "_ios_public_config"
+ config(_framework_public_config) {
+ visibility = [ ":$_framework_public_config" ]
+ if (defined(_public_headers)) {
+ common_flags = [ "-F" + rebase_path("$root_out_dir/.", root_out_dir) ]
+ cflags_objc = common_flags
+ cflags_objcc = common_flags
+ }
+
+ # The link settings are inherited from the framework_bundle config.
+ }
+
framework_bundle(_framework_target) {
forward_variables_from(invoker,
"*",
@@ -342,8 +361,16 @@ template("ios_framework_bundle") {
])
output_name = _output_name
+ if (!defined(public_configs)) {
+ public_configs = []
+ }
+ public_configs += [ ":$_framework_public_config" ]
+
if (defined(_public_headers)) {
- visibility = [ ":$_target_name" ]
+ visibility = [
+ ":$_target_name",
+ ":$_target_name+link",
+ ]
configs += [ ":$_headers_map_config" ]
if (!defined(deps)) {
@@ -351,7 +378,10 @@ template("ios_framework_bundle") {
}
deps += [ ":$_framework_headers_target" ]
} else {
- forward_variables_from(invoker, [ "visibility" ])
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ visibility += [ ":$_target_name+link" ]
+ }
}
}
@@ -360,13 +390,28 @@ template("ios_framework_bundle") {
forward_variables_from(invoker,
[
"testonly",
- "visibility",
"public_configs",
])
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ visibility += [ ":$_target_name+link" ]
+ }
+
public_deps = [
":$_framework_target",
]
}
+
+ group(_target_name + "+link") {
+ forward_variables_from(invoker,
+ [
+ "testonly",
+ "visibility",
+ ])
+ public_deps = [
+ ":$_framework_target+link",
+ ]
+ }
}
}
« no previous file with comments | « no previous file | build/config/mac/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698