Commit e8c24cd2 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios/mac] Use framework_dirs to set framework search path

Instead of passing -F ... via cflags & ldflags, use the new config
parameter framework_dirs to set the framework search path. As this
is properly propagated, stop using all_dependent_configs in favor
of just public_configs.

Fix the definition of the ios_framework_bundle template to not pass
the public_configs to the internal source_set and shared_library
target in order to fix the build with goma RBE.

Change libs to frameworks to give the list of frameworks in the
modified files (to reduce the churn).

Add missing dependency on //ios/third_party/webkit.

Bug: 1052560
Change-Id: I8ba046bec961edd6396509cc087782013a66e7a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2061194
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742215}
parent 24e1f839
...@@ -109,15 +109,9 @@ config("ios_dynamic_flags") { ...@@ -109,15 +109,9 @@ config("ios_dynamic_flags") {
} }
config("xctest_config") { config("xctest_config") {
common_flags = [ framework_dirs = [ "$ios_sdk_platform_path/Developer/Library/Frameworks" ]
"-F",
"$ios_sdk_platform_path/Developer/Library/Frameworks",
]
cflags = common_flags
ldflags = common_flags
libs = [ frameworks = [
"Foundation.framework", "Foundation.framework",
"XCTest.framework", "XCTest.framework",
] ]
......
...@@ -628,10 +628,10 @@ template("ios_app_bundle") { ...@@ -628,10 +628,10 @@ template("ios_app_bundle") {
} }
deps += [ ":$_arch_executable_source" ] deps += [ ":$_arch_executable_source" ]
if (!defined(libs)) { if (!defined(frameworks)) {
libs = [] frameworks = []
} }
libs += [ "UIKit.framework" ] frameworks += [ "UIKit.framework" ]
if (!defined(ldflags)) { if (!defined(ldflags)) {
ldflags = [] ldflags = []
...@@ -1201,11 +1201,7 @@ template("ios_framework_bundle") { ...@@ -1201,11 +1201,7 @@ template("ios_framework_bundle") {
_framework_headers_target = _target_name + "_framework_headers" _framework_headers_target = _target_name + "_framework_headers"
_framework_headers_config = _target_name + "_framework_headers_config" _framework_headers_config = _target_name + "_framework_headers_config"
config(_framework_headers_config) { config(_framework_headers_config) {
# The link settings are inherited from the framework_bundle config. framework_dirs = [ _default_toolchain_root_out_dir ]
cflags = [
"-F",
rebase_path("$_default_toolchain_root_out_dir/.", root_build_dir),
]
} }
_headers_map_config = _target_name + "_headers_map" _headers_map_config = _target_name + "_headers_map"
...@@ -1224,15 +1220,8 @@ template("ios_framework_bundle") { ...@@ -1224,15 +1220,8 @@ template("ios_framework_bundle") {
_framework_public_config = _target_name + "_public_config" _framework_public_config = _target_name + "_public_config"
config(_framework_public_config) { config(_framework_public_config) {
# TODO(sdefresne): should we have a framework_dirs similar to lib_dirs configs = [ ":$_framework_headers_config" ]
# and include_dirs to avoid duplicate values on the command-line. frameworks = [ "$_output_name.framework" ]
visibility = [ ":${_target_name}_signed_bundle" ]
ldflags = [
"-F",
rebase_path("$_default_toolchain_root_out_dir/.", root_build_dir),
]
lib_dirs = [ root_out_dir ]
libs = [ "$_output_name.framework" ]
} }
source_set(_arch_shared_library_source) { source_set(_arch_shared_library_source) {
...@@ -1247,16 +1236,14 @@ template("ios_framework_bundle") { ...@@ -1247,16 +1236,14 @@ template("ios_framework_bundle") {
"info_plist", "info_plist",
"info_plist_target", "info_plist_target",
"output_name", "output_name",
"public_configs",
"visibility", "visibility",
]) ])
visibility = [ ":$_arch_shared_library_target" ] visibility = [ ":$_arch_shared_library_target" ]
if (_has_public_headers) { if (_has_public_headers) {
configs += [ configs += [ ":$_headers_map_config" ]
":$_framework_headers_config",
":$_headers_map_config",
]
if (!defined(deps)) { if (!defined(deps)) {
deps = [] deps = []
...@@ -1278,6 +1265,7 @@ template("ios_framework_bundle") { ...@@ -1278,6 +1265,7 @@ template("ios_framework_bundle") {
"info_plist_target", "info_plist_target",
"output_name", "output_name",
"sources", "sources",
"public_configs",
"visibility", "visibility",
]) ])
......
...@@ -289,19 +289,9 @@ template("mac_framework_bundle") { ...@@ -289,19 +289,9 @@ template("mac_framework_bundle") {
_framework_public_config = _target_name + "_public_config" _framework_public_config = _target_name + "_public_config"
config(_framework_public_config) { config(_framework_public_config) {
# TODO(sdefresne): should we have a framework_dirs similar to lib_dirs
# and include_dirs to avoid duplicate values on the command-line.
visibility = [ ":$_framework_target" ] visibility = [ ":$_framework_target" ]
cflags = [ framework_dirs = [ root_out_dir ]
"-F", frameworks = [ _framework_name ]
rebase_path("$root_out_dir/.", root_build_dir),
]
ldflags = [
"-F",
rebase_path("$root_out_dir/.", root_build_dir),
]
lib_dirs = [ root_out_dir ]
libs = [ _framework_name ]
} }
create_bundle(_framework_target) { create_bundle(_framework_target) {
......
...@@ -23,15 +23,15 @@ config("cronet_include_config") { ...@@ -23,15 +23,15 @@ config("cronet_include_config") {
} }
config("cronet_static_config") { config("cronet_static_config") {
libs = [ frameworks = [
"Cronet.framework", "Cronet.framework",
"UIKit.framework", "UIKit.framework",
"CFNetwork.framework", "CFNetwork.framework",
"MobileCoreServices.framework", "MobileCoreServices.framework",
"Security.framework", "Security.framework",
"SystemConfiguration.framework", "SystemConfiguration.framework",
"resolv",
] ]
libs = [ "resolv" ]
configs = [ ":cronet_include_config" ] configs = [ ":cronet_include_config" ]
} }
...@@ -108,7 +108,7 @@ ios_framework_bundle("cronet_framework") { ...@@ -108,7 +108,7 @@ ios_framework_bundle("cronet_framework") {
"//net:net", "//net:net",
] ]
libs = [ "UIKit.framework" ] frameworks = [ "UIKit.framework" ]
public_deps = [ "//components/grpc_support:headers" ] public_deps = [ "//components/grpc_support:headers" ]
......
...@@ -26,8 +26,7 @@ template("cronet_consumer_template") { ...@@ -26,8 +26,7 @@ template("cronet_consumer_template") {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"bundle_deps", "bundle_deps",
"cflags", "framework_dirs",
"ldflags",
]) ])
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
...@@ -45,15 +44,6 @@ cronet_consumer_template("cronet_consumer") { ...@@ -45,15 +44,6 @@ cronet_consumer_template("cronet_consumer") {
if (!defined(additional_target_cpus) || additional_target_cpus == []) { if (!defined(additional_target_cpus) || additional_target_cpus == []) {
cronet_consumer_template("cronet_consumer_static") { cronet_consumer_template("cronet_consumer_static") {
deps = [ "//components/cronet/ios:cronet_static_framework" ] deps = [ "//components/cronet/ios:cronet_static_framework" ]
framework_dirs = [ "$root_out_dir/Static" ]
cflags = [
"-F",
"Static",
]
ldflags = [
"-F",
"Static",
]
} }
} }
...@@ -294,7 +294,7 @@ ios_framework_bundle("earl_grey") { ...@@ -294,7 +294,7 @@ ios_framework_bundle("earl_grey") {
] ]
public_deps = [ "//ios/third_party/ochamcrest:ochamcrest+link" ] public_deps = [ "//ios/third_party/ochamcrest:ochamcrest+link" ]
libs = [ frameworks = [
"CoreData.framework", "CoreData.framework",
"CoreGraphics.framework", "CoreGraphics.framework",
"Foundation.framework", "Foundation.framework",
...@@ -303,13 +303,13 @@ ios_framework_bundle("earl_grey") { ...@@ -303,13 +303,13 @@ ios_framework_bundle("earl_grey") {
"UIKit.framework", "UIKit.framework",
"XCTest.framework", "XCTest.framework",
] ]
public_configs = [ ":config" ]
configs -= [ configs -= [
"//build/config/gcc:symbol_visibility_hidden", "//build/config/gcc:symbol_visibility_hidden",
"//build/config/compiler:chromium_code", "//build/config/compiler:chromium_code",
] ]
configs += [ configs += [
":config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
"//build/config/compiler:enable_arc", "//build/config/compiler:enable_arc",
"//build/config/gcc:symbol_visibility_default", "//build/config/gcc:symbol_visibility_default",
......
...@@ -3,25 +3,13 @@ ...@@ -3,25 +3,13 @@
# found in the LICENSE file. # found in the LICENSE file.
source_set("firebase") { source_set("firebase") {
# From gn documentation:
# https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#ldflags
# "ldflags are NOT pushed to dependents, so applying ldflags to source sets
# or static libraries will be a no-op. If you want to apply ldflags to
# dependent targets, put them in a config and set it in the
# all_dependent_configs or public_configs."
#
# This source_set must be specified as a direct deps of an ios_app_bundle
# target for ldflags specified in :firebase_config to be applied.
public_configs = [ ":firebase_config" ] public_configs = [ ":firebase_config" ]
} }
config("firebase_config") { config("firebase_config") {
visibility = [ ":firebase" ] visibility = [ ":firebase" ]
ldflags = [ framework_dirs = [ "Analytics" ]
"-F", frameworks = [
rebase_path("Analytics", root_build_dir),
]
libs = [
"FirebaseAnalytics.framework", "FirebaseAnalytics.framework",
"FirebaseCore.framework", "FirebaseCore.framework",
"FirebaseCoreDiagnostics.framework", "FirebaseCoreDiagnostics.framework",
...@@ -30,7 +18,9 @@ config("firebase_config") { ...@@ -30,7 +18,9 @@ config("firebase_config") {
"GoogleUtilities.framework", "GoogleUtilities.framework",
"nanopb.framework", "nanopb.framework",
"StoreKit.framework", "StoreKit.framework",
]
libs = [
# GoogleAppMeasurement.framework is a framework containing a static library # GoogleAppMeasurement.framework is a framework containing a static library
# and it has a dependency on sqlite3. It cannot use the version built with # and it has a dependency on sqlite3. It cannot use the version built with
# Chromium since the names are mangled, so add the dependency here. # Chromium since the names are mangled, so add the dependency here.
......
...@@ -1455,7 +1455,7 @@ target(_mdc_target_type, "material_components_ios") { ...@@ -1455,7 +1455,7 @@ target(_mdc_target_type, "material_components_ios") {
public_headers = _mdc_public_headers public_headers = _mdc_public_headers
} }
libs = [ frameworks = [
"CoreGraphics.framework", "CoreGraphics.framework",
"CoreText.framework", "CoreText.framework",
"QuartzCore.framework", "QuartzCore.framework",
......
...@@ -13,7 +13,7 @@ group("webkit") { ...@@ -13,7 +13,7 @@ group("webkit") {
deps = [ ":bundle_webkit_frameworks" ] deps = [ ":bundle_webkit_frameworks" ]
} }
all_dependent_configs = [ ":_webkit_config" ] public_configs = [ ":_webkit_config" ]
} }
if (_build_custom_webkit) { if (_build_custom_webkit) {
...@@ -110,15 +110,8 @@ config("_webkit_config") { ...@@ -110,15 +110,8 @@ config("_webkit_config") {
# From the ld documentation: "Directories specified with -F are searched in # From the ld documentation: "Directories specified with -F are searched in
# the order they appear on the command line and before the default search # the order they appear on the command line and before the default search
# path." # path."
_framework_out_dir = "$target_out_dir/$_webkit_xcodebuild_out_dir" framework_dirs = [ "$target_out_dir/$_webkit_xcodebuild_out_dir" ]
common_flags = [
"-F",
rebase_path("$_framework_out_dir/", root_build_dir),
]
cflags = common_flags
ldflags = common_flags
} }
libs = [ "WebKit.framework" ] frameworks = [ "WebKit.framework" ]
} }
...@@ -29,6 +29,7 @@ source_set("inttests") { ...@@ -29,6 +29,7 @@ source_set("inttests") {
"//base/test:run_all_unittests", "//base/test:run_all_unittests",
"//base/test:test_support", "//base/test:test_support",
"//components/url_formatter", "//components/url_formatter",
"//ios/third_party/webkit",
"//ios/web_view:web_view+link", "//ios/web_view:web_view+link",
"//net", "//net",
"//net:test_support", "//net:test_support",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment