Index: ios/web_view/internal/BUILD.gn |
diff --git a/ios/web_view/internal/BUILD.gn b/ios/web_view/internal/BUILD.gn |
index 496def8e8c552235f808c96e6b8443c0463a6721..61e187d62eac2cd84431c2d1e0eb02b722c99365 100644 |
--- a/ios/web_view/internal/BUILD.gn |
+++ b/ios/web_view/internal/BUILD.gn |
@@ -2,12 +2,28 @@ |
# 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. Used as an input of |
+# :lib_web_view. |
+static_library("web_view_incomplete") { |
+ visibility = [ ":*" ] |
sources = [ |
"criwv.mm", |
"criwv_browser_state.h", |
@@ -27,22 +43,49 @@ source_set("internal") { |
"pref_names.cc", |
"pref_names.h", |
] |
+ deps = _deps |
+ allow_circular_includes_from = [ "//ios/web_view/internal/translate" ] |
+} |
+ |
+# A static library which contains all dependencies of :web_view_incomplete. |
+# Used to build "web_view". |
michaeldo
2017/02/07 18:14:20
Please remove the second comment line ("Used to bu
Hiroshi Ichikawa
2017/02/08 01:16:21
Done.
|
+static_library("deps_complete") { |
+ visibility = [ ":*" ] |
+ complete_static_lib = true |
+ deps = _deps |
+} |
+ |
+# A static library expected to be used by apps outside Chromium code base. |
michaeldo
2017/02/07 18:14:20
I suggest removing these comments. The public inte
Hiroshi Ichikawa
2017/02/08 01:16:21
Done.
|
+# This is a complete static library (containing all dependencies), |
+# and it doesn't expose internal symbols to reduce risk of symbol conflict. |
+# |
+# //ios/web_view is an alias of this library. |
+# |
+# TODO(ichikawa): Support building a universal binary. |
+action("lib_web_view") { |
+ visibility = [ |
+ "//ios/web_view", |
+ "//ios/web_view/internal/*", |
+ ] |
+ script = "hide_symbols.py" |
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", |
+ ":deps_complete", |
+ ":web_view_incomplete", |
+ ] |
+ outputs = [ |
+ "$target_out_dir/libweb_view.a", |
+ "$target_out_dir/libweb_view.o", |
+ ] |
+ args = [ |
+ "--input_lib", |
+ 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, |
] |
- allow_circular_includes_from = [ "//ios/web_view/internal/translate" ] |
} |