Commit 64215a0c authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios][remoting] Improve linking with MaterialComponents.framework

Change remoting code to only link with MaterialComponents.framework if
the code is compiled as a framework (this will allow removing the fake
targets that exists in ios/third_party/material_components_ios/BUILD.gn).

If using MaterialComponents.framework, then bundle it with the app.

This is a reland of https://crrev.com/c/2020960 with a fix for the
compilation of ios_remoting_unittests when building a framework for
MaterialComponents (which is the default on the internal builder and
why the original CL was reverted).

Bug: 1040871
Change-Id: I77bb04480bc6b7b1a01133a795f73bc5860b7686
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023888Reviewed-by: default avatarYuwei Huang <yuweih@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736011}
parent a96cdac9
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//ios/third_party/features.gni")
import("//remoting/build/config/remoting_build.gni") import("//remoting/build/config/remoting_build.gni")
import("//remoting/remoting_locales.gni") import("//remoting/remoting_locales.gni")
...@@ -84,9 +85,13 @@ test("ios_remoting_unittests") { ...@@ -84,9 +85,13 @@ test("ios_remoting_unittests") {
deps += [ ":unittests_locale_${locale}_bundle_data" ] deps += [ ":unittests_locale_${locale}_bundle_data" ]
} }
bundle_deps = [ if (ios_third_party_material_components_built_as_framework) {
"//ios/third_party/material_components_ios:material_components_ios+bundle", deps += [
] "//ios/third_party/material_components_ios:material_components_ios+link",
]
bundle_deps = [ "//ios/third_party/material_components_ios:material_components_ios+bundle" ]
}
} }
foreach(locale, remoting_locales_with_underscores) { foreach(locale, remoting_locales_with_underscores) {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//ios/third_party/features.gni")
import("//remoting/build/config/remoting_build.gni") import("//remoting/build/config/remoting_build.gni")
import("//remoting/ios/app/remoting_ios_tmpl.gni") import("//remoting/ios/app/remoting_ios_tmpl.gni")
...@@ -111,7 +112,7 @@ source_set("common_source_set") { ...@@ -111,7 +112,7 @@ source_set("common_source_set") {
} }
public_deps = [ public_deps = [
"//ios/third_party/material_components_ios:material_components_ios+link", "//ios/third_party/material_components_ios",
"//remoting/ios/facade", "//remoting/ios/facade",
] ]
...@@ -144,8 +145,14 @@ ios_remoting_app_tmpl("ios_remoting_app") { ...@@ -144,8 +145,14 @@ ios_remoting_app_tmpl("ios_remoting_app") {
entitlements_path = "resources/Remoting.entitlements" entitlements_path = "resources/Remoting.entitlements"
deps = [ deps = [
":app_source_set", ":app_source_set",
"//ios/third_party/material_components_ios:material_components_ios+bundle",
"//remoting/ios/app/resources:launchscreen_assets", "//remoting/ios/app/resources:launchscreen_assets",
"//remoting/ios/app/resources:remoting_icons", "//remoting/ios/app/resources:remoting_icons",
] ]
if (ios_third_party_material_components_built_as_framework) {
deps += [
"//ios/third_party/material_components_ios:material_components_ios+bundle",
"//ios/third_party/material_components_ios:material_components_ios+link",
]
}
} }
...@@ -27,9 +27,7 @@ source_set("settings") { ...@@ -27,9 +27,7 @@ source_set("settings") {
"//ui/resources", "//ui/resources",
] ]
public_deps = [ public_deps = [ "//ios/third_party/material_components_ios" ]
"//ios/third_party/material_components_ios:material_components_ios+link",
]
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
} }
...@@ -25,7 +25,7 @@ source_set("facade") { ...@@ -25,7 +25,7 @@ source_set("facade") {
deps = [ deps = [
"//base", "//base",
"//ios/third_party/material_components_ios:material_components_ios+link", "//ios/third_party/material_components_ios",
"//remoting/base:authorization", "//remoting/base:authorization",
"//remoting/client", "//remoting/client",
"//remoting/ios/domain", "//remoting/ios/domain",
......
...@@ -14,9 +14,7 @@ source_set("mdc") { ...@@ -14,9 +14,7 @@ source_set("mdc") {
libs = [ "UIKit.framework" ] libs = [ "UIKit.framework" ]
deps = [ deps = [ "//ios/third_party/material_components_ios" ]
"//ios/third_party/material_components_ios:material_components_ios+link",
]
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
} }
...@@ -16,7 +16,7 @@ source_set("session") { ...@@ -16,7 +16,7 @@ source_set("session") {
deps = [ deps = [
"//base", "//base",
"//ios/third_party/material_components_ios:material_components_ios+link", "//ios/third_party/material_components_ios",
"//remoting/client", "//remoting/client",
"//remoting/client/display", "//remoting/client/display",
"//remoting/client/ui", "//remoting/client/ui",
......
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