Index: ios/web_view/internal/BUILD.gn |
diff --git a/ios/web_view/internal/BUILD.gn b/ios/web_view/internal/BUILD.gn |
index 41966934a067f6831203999be9e01459b48de854..94245f49606ce062d1cadd9642104104ce1da0fd 100644 |
--- a/ios/web_view/internal/BUILD.gn |
+++ b/ios/web_view/internal/BUILD.gn |
@@ -2,11 +2,27 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-source_set("internal") { |
- visibility = [ |
- "//ios/web_view", |
- "//ios/web_view/internal/*", |
- ] |
+_deps = [ |
+ "//base", |
+ "//components/pref_registry", |
+ "//components/prefs", |
+ "//components/translate/core/browser", |
+ "//components/translate/core/common", |
+ "//ios/net", |
+ "//ios/web", |
+ "//ios/web:user_agent", |
+ "//ios/web/public/app", |
+ "//ios/web_view/internal/translate", |
+ "//ios/web_view/public", |
+ "//net", |
+ "//net:extras", |
+ "//ui/base", |
+ "//url", |
+] |
+ |
+# An incomplete static library for //ios/web_view. |
+static_library("web_view_incomplete") { |
+ visibility = [ ":*" ] |
sources = [ |
"cwv.mm", |
@@ -33,25 +49,48 @@ source_set("internal") { |
"web_view_web_main_parts.h", |
"web_view_web_main_parts.mm", |
] |
- deps = [ |
- "//base", |
- "//components/pref_registry", |
- "//components/prefs", |
- "//components/translate/core/browser", |
- "//components/translate/core/common", |
- "//ios/net", |
- "//ios/web", |
- "//ios/web:user_agent", |
- "//ios/web/public/app", |
- "//ios/web_view/internal/translate", |
- "//ios/web_view/public", |
- "//net", |
- "//net:extras", |
- "//ui/base", |
- "//url", |
- ] |
- allow_circular_includes_from = [ "//ios/web_view/internal/translate" ] |
+ deps = _deps |
configs += [ "//build/config/compiler:enable_arc" ] |
+ |
+ allow_circular_includes_from = [ "//ios/web_view/internal/translate" ] |
+} |
+ |
+# A static library which contains all dependencies of :web_view_incomplete. |
+static_library("deps_complete") { |
+ visibility = [ ":*" ] |
+ complete_static_lib = true |
+ deps = _deps |
+} |
+ |
+# See the comment of //ios/web_view, which is a public alias of this library. |
+# |
+# TODO(crbug.com/689755): Support building a universal binary. |
+action("lib_web_view") { |
+ visibility = [ |
+ "//ios/web_view", |
+ "//ios/web_view/internal/*", |
+ ] |
+ script = "hide_symbols.py" |
+ deps = [ |
+ ":deps_complete", |
+ ":web_view_incomplete", |
+ ] |
+ outputs = [ |
+ "$target_out_dir/libweb_view.a", |
+ "$target_out_dir/libweb_view.o", |
+ ] |
+ args = [ |
+ "--input_libs", |
+ rebase_path("$target_out_dir/libweb_view_incomplete.a", root_build_dir), |
+ "--deps_lib", |
+ rebase_path("$target_out_dir/libdeps_complete.a", root_build_dir), |
+ "--output_obj", |
+ rebase_path("$target_out_dir/libweb_view.o", root_build_dir), |
+ "--output_lib", |
+ rebase_path("$target_out_dir/libweb_view.a", root_build_dir), |
+ "--current_cpu", |
+ current_cpu, |
+ ] |
} |