summaryrefslogtreecommitdiffstats
path: root/url/BUILD.gn
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 14:05:46 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 14:05:46 +0000
commit847aaab8e8dfd869c620e7fa0772562ca46f52af (patch)
tree4b3d4cc054aaeafc2ceb4abda5457f09e59abf59 /url/BUILD.gn
parente83140a012c770fe4ac438ddc42d2095a982d220 (diff)
downloadchromium_src-847aaab8e8dfd869c620e7fa0772562ca46f52af.zip
chromium_src-847aaab8e8dfd869c620e7fa0772562ca46f52af.tar.gz
chromium_src-847aaab8e8dfd869c620e7fa0772562ca46f52af.tar.bz2
Make it possible to build url/ without ICU on android.
This is needed to reduce binary size of net/ when build as a library. BUG=362608 Review URL: https://codereview.chromium.org/257673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url/BUILD.gn')
-rw-r--r--url/BUILD.gn43
1 files changed, 42 insertions, 1 deletions
diff --git a/url/BUILD.gn b/url/BUILD.gn
index 6445bfb..faf8dd8 100644
--- a/url/BUILD.gn
+++ b/url/BUILD.gn
@@ -2,12 +2,26 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+declare_args() {
+ # Switches to using platform functions instead of ICU on Android.
+ use_icu_alternatives_on_android = false
+}
+
+# Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag.
+config("url_icu_config") {
+ if (use_icu_alternatives_on_android) {
+ defines = [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ]
+ }
+}
+
component("url") {
if (is_win) {
# Don't conflict with Windows' "url.dll".
output_name = "url_lib"
}
sources = [
+ "android/url_jni_registrar.cc",
+ "android/url_jni_registrar.h",
"gurl.cc",
"gurl.h",
"third_party/mozilla/url_parse.cc",
@@ -42,6 +56,8 @@ component("url") {
defines = [ "URL_IMPLEMENTATION" ]
+ configs += [ ":url_icu_config" ]
+
# if (is_win) {
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
# 'msvs_disabled_warnings': [ 4267, ]
@@ -52,6 +68,22 @@ component("url") {
"//third_party/icu:icudata",
"//third_party/icu",
]
+
+ if (use_icu_alternatives_on_android) {
+ sources -= [
+ "url_canon_icu.cc",
+ "url_canon_icu.h",
+ ]
+ deps -= [
+ "//third_party/icu:icudata",
+ "//third_party/icu",
+ ]
+
+ sources += [
+ "url_canon_icu_alternatives_android.cc",
+ "url_canon_icu_alternatives_android.h",
+ ]
+ }
}
# TODO(dpranke): crbug.com/360936. Get this to build and run on Android.
@@ -59,6 +91,7 @@ if (!is_android) {
test("url_unittests") {
sources = [
"gurl_unittest.cc",
+ "url_canon_icu_unittest.cc",
"url_canon_unittest.cc",
"url_parse_unittest.cc",
"url_test_utils.h",
@@ -79,10 +112,18 @@ if (!is_android) {
deps = [
":url",
- "//base:i18n",
"//base/test:run_all_unittests",
"//testing/gtest",
"//third_party/icu:icuuc",
]
+
+ if (use_icu_alternatives_on_android) {
+ sources -= [
+ "url_canon_icu_unittest.cc",
+ ]
+ deps -= [
+ "//third_party/icu:icuuc",
+ ]
+ }
}
}