Index: build/config/ios/rules.gni |
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni |
index 0ceb265883c8bdc0c6aed720b6323cae8e9509bd..e21779fd43e9392e175a1324de811be6fb956d34 100644 |
--- a/build/config/ios/rules.gni |
+++ b/build/config/ios/rules.gni |
@@ -5,6 +5,12 @@ |
import("//build/config/ios/ios_sdk.gni") |
import("//build/config/mac/base_rules.gni") |
import("//build/config/mac/symbols.gni") |
+ |
+# Control whether an intermediate source_set is used when building executables |
+# and shared_libraries for ios_app_bundle and ios_framework_bundle. This is a |
+# temporary flag that will be removed once scoped_nsobject_unittest{_arc}.mm |
+# tests are passing with this flag set to true (see crbug.com/637065) |
+_use_intermediate_source_set = false |
# Invokes lipo on multiple arch-specific binaries to create a fat binary. |
# |
@@ -369,25 +375,30 @@ |
_arch_executable_target = _target_name + "_arch_executable" |
_lipo_executable_target = _target_name + "_executable" |
- source_set(_arch_executable_source) { |
- forward_variables_from(invoker, |
- "*", |
- [ |
- "bundle_deps", |
- "bundle_deps_filter", |
- "bundle_extension", |
- "enable_code_signing", |
- "entitlements_path", |
- "extra_substitutions", |
- "extra_system_frameworks", |
- "info_plist", |
- "info_plist_target", |
- "output_name", |
- "product_type", |
- "visibility", |
- ]) |
- |
- visibility = [ ":$_arch_executable_target" ] |
+ if (_use_intermediate_source_set) { |
+ source_set(_arch_executable_source) { |
+ forward_variables_from(invoker, |
+ "*", |
+ [ |
+ "bundle_deps", |
+ "bundle_deps_filter", |
+ "bundle_extension", |
+ "enable_code_signing", |
+ "entitlements_path", |
+ "extra_substitutions", |
+ "extra_system_frameworks", |
+ "info_plist", |
+ "info_plist_target", |
+ "output_name", |
+ "product_type", |
+ "visibility", |
+ ]) |
+ |
+ visibility = [ ":$_arch_executable_target" ] |
+ } |
+ } else { |
+ assert(_arch_executable_source != "", |
+ "mark _arch_executable_source as used") |
} |
if (use_ios_simulator) { |
@@ -415,6 +426,9 @@ |
"sources", |
"visibility", |
]) |
+ if (!_use_intermediate_source_set) { |
+ forward_variables_from(invoker, [ "sources" ]) |
+ } |
visibility = [ ":$_lipo_executable_target($default_toolchain)" ] |
if (current_toolchain != default_toolchain) { |
@@ -424,7 +438,9 @@ |
if (!defined(deps)) { |
deps = [] |
} |
- deps += [ ":$_arch_executable_source" ] |
+ if (_use_intermediate_source_set) { |
+ deps += [ ":$_arch_executable_source" ] |
+ } |
if (!defined(libs)) { |
libs = [] |
@@ -862,33 +878,38 @@ |
_arch_shared_library_target = _target_name + "_arch_shared_library" |
_lipo_shared_library_target = _target_name + "_shared_library" |
- source_set(_arch_shared_library_source) { |
- forward_variables_from(invoker, |
- "*", |
- [ |
- "bundle_deps", |
- "bundle_deps_filter", |
- "data_deps", |
- "enable_code_signing", |
- "info_plist", |
- "info_plist_target", |
- "output_name", |
- "visibility", |
- ]) |
- |
- visibility = [ ":$_arch_shared_library_target" ] |
- |
- if (_has_public_headers) { |
- configs += [ |
- ":$_framework_headers_config($default_toolchain)", |
- ":$_headers_map_config($default_toolchain)", |
- ] |
- |
- if (!defined(deps)) { |
- deps = [] |
- } |
- deps += [ ":$_framework_headers_target($default_toolchain)" ] |
- } |
+ if (_use_intermediate_source_set) { |
+ source_set(_arch_shared_library_source) { |
+ forward_variables_from(invoker, |
+ "*", |
+ [ |
+ "bundle_deps", |
+ "bundle_deps_filter", |
+ "data_deps", |
+ "enable_code_signing", |
+ "info_plist", |
+ "info_plist_target", |
+ "output_name", |
+ "visibility", |
+ ]) |
+ |
+ visibility = [ ":$_arch_shared_library_target" ] |
+ |
+ if (_has_public_headers) { |
+ configs += [ |
+ ":$_framework_headers_config($default_toolchain)", |
+ ":$_headers_map_config($default_toolchain)", |
+ ] |
+ |
+ if (!defined(deps)) { |
+ deps = [] |
+ } |
+ deps += [ ":$_framework_headers_target($default_toolchain)" ] |
+ } |
+ } |
+ } else { |
+ assert(_arch_shared_library_source != "", |
+ "mark _arch_shared_library_source as used") |
} |
shared_library(_arch_shared_library_target) { |
@@ -905,6 +926,9 @@ |
"sources", |
"visibility", |
]) |
+ if (!_use_intermediate_source_set) { |
+ forward_variables_from(invoker, [ "sources" ]) |
+ } |
visibility = [ ":$_lipo_shared_library_target($default_toolchain)" ] |
if (current_toolchain != default_toolchain) { |
@@ -914,7 +938,21 @@ |
if (!defined(deps)) { |
deps = [] |
} |
- deps += [ ":$_arch_shared_library_source" ] |
+ if (_use_intermediate_source_set) { |
+ deps += [ ":$_arch_shared_library_source" ] |
+ } else { |
+ if (_has_public_headers) { |
+ configs += [ |
+ ":$_framework_headers_config($default_toolchain)", |
+ ":$_headers_map_config($default_toolchain)", |
+ ] |
+ |
+ if (!defined(deps)) { |
+ deps = [] |
+ } |
+ deps += [ ":$_framework_headers_target($default_toolchain)" ] |
+ } |
+ } |
output_extension = "" |
output_name = _output_name |