OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 declare_args() { |
| 6 # Switches to using platform functions instead of ICU on Android. |
| 7 use_icu_alternatives_on_android = false |
| 8 } |
| 9 |
| 10 # Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag. |
| 11 config("url_icu_config") { |
| 12 if (use_icu_alternatives_on_android) { |
| 13 defines = [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ] |
| 14 } |
| 15 } |
| 16 |
5 component("url") { | 17 component("url") { |
6 if (is_win) { | 18 if (is_win) { |
7 # Don't conflict with Windows' "url.dll". | 19 # Don't conflict with Windows' "url.dll". |
8 output_name = "url_lib" | 20 output_name = "url_lib" |
9 } | 21 } |
10 sources = [ | 22 sources = [ |
| 23 "android/url_jni_registrar.cc", |
| 24 "android/url_jni_registrar.h", |
11 "gurl.cc", | 25 "gurl.cc", |
12 "gurl.h", | 26 "gurl.h", |
13 "third_party/mozilla/url_parse.cc", | 27 "third_party/mozilla/url_parse.cc", |
14 "third_party/mozilla/url_parse.h", | 28 "third_party/mozilla/url_parse.h", |
15 "url_canon.h", | 29 "url_canon.h", |
16 "url_canon_etc.cc", | 30 "url_canon_etc.cc", |
17 "url_canon_filesystemurl.cc", | 31 "url_canon_filesystemurl.cc", |
18 "url_canon_fileurl.cc", | 32 "url_canon_fileurl.cc", |
19 "url_canon_host.cc", | 33 "url_canon_host.cc", |
20 "url_canon_icu.cc", | 34 "url_canon_icu.cc", |
(...skipping 14 matching lines...) Expand all Loading... |
35 "url_export.h", | 49 "url_export.h", |
36 "url_file.h", | 50 "url_file.h", |
37 "url_parse_file.cc", | 51 "url_parse_file.cc", |
38 "url_parse_internal.h", | 52 "url_parse_internal.h", |
39 "url_util.cc", | 53 "url_util.cc", |
40 "url_util.h", | 54 "url_util.h", |
41 ] | 55 ] |
42 | 56 |
43 defines = [ "URL_IMPLEMENTATION" ] | 57 defines = [ "URL_IMPLEMENTATION" ] |
44 | 58 |
| 59 configs += [ ":url_icu_config" ] |
| 60 |
45 # if (is_win) { | 61 # if (is_win) { |
46 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 62 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
47 # 'msvs_disabled_warnings': [ 4267, ] | 63 # 'msvs_disabled_warnings': [ 4267, ] |
48 # } | 64 # } |
49 | 65 |
50 deps = [ | 66 deps = [ |
51 "//base", | 67 "//base", |
52 "//third_party/icu:icudata", | 68 "//third_party/icu:icudata", |
53 "//third_party/icu", | 69 "//third_party/icu", |
54 ] | 70 ] |
| 71 |
| 72 if (use_icu_alternatives_on_android) { |
| 73 sources -= [ |
| 74 "url_canon_icu.cc", |
| 75 "url_canon_icu.h", |
| 76 ] |
| 77 deps -= [ |
| 78 "//third_party/icu:icudata", |
| 79 "//third_party/icu", |
| 80 ] |
| 81 |
| 82 sources += [ |
| 83 "url_canon_icu_alternatives_android.cc", |
| 84 "url_canon_icu_alternatives_android.h", |
| 85 ] |
| 86 } |
55 } | 87 } |
56 | 88 |
57 # TODO(dpranke): crbug.com/360936. Get this to build and run on Android. | 89 # TODO(dpranke): crbug.com/360936. Get this to build and run on Android. |
58 if (!is_android) { | 90 if (!is_android) { |
59 test("url_unittests") { | 91 test("url_unittests") { |
60 sources = [ | 92 sources = [ |
61 "gurl_unittest.cc", | 93 "gurl_unittest.cc", |
| 94 "url_canon_icu_unittest.cc", |
62 "url_canon_unittest.cc", | 95 "url_canon_unittest.cc", |
63 "url_parse_unittest.cc", | 96 "url_parse_unittest.cc", |
64 "url_test_utils.h", | 97 "url_test_utils.h", |
65 "url_util_unittest.cc", | 98 "url_util_unittest.cc", |
66 ] | 99 ] |
67 | 100 |
68 #if (is_posix && !is_mac && !is_ios) { | 101 #if (is_posix && !is_mac && !is_ios) { |
69 # # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554 | 102 # # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554 |
70 # if ((use_allocator!="none" && use_allocator!="see_use_tcmalloc") || (use_
allocator=="see_use_tcmalloc" && linux_use_tcmalloc) { | 103 # if ((use_allocator!="none" && use_allocator!="see_use_tcmalloc") || (use_
allocator=="see_use_tcmalloc" && linux_use_tcmalloc) { |
71 # deps += "//base/allocator" | 104 # deps += "//base/allocator" |
72 # } | 105 # } |
73 #} | 106 #} |
74 | 107 |
75 # if (is_win) { | 108 # if (is_win) { |
76 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 109 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
77 # 'msvs_disabled_warnings': [ 4267, ] | 110 # 'msvs_disabled_warnings': [ 4267, ] |
78 # } | 111 # } |
79 | 112 |
80 deps = [ | 113 deps = [ |
81 ":url", | 114 ":url", |
82 "//base:i18n", | |
83 "//base/test:run_all_unittests", | 115 "//base/test:run_all_unittests", |
84 "//testing/gtest", | 116 "//testing/gtest", |
85 "//third_party/icu:icuuc", | 117 "//third_party/icu:icuuc", |
86 ] | 118 ] |
| 119 |
| 120 if (use_icu_alternatives_on_android) { |
| 121 sources -= [ |
| 122 "url_canon_icu_unittest.cc", |
| 123 ] |
| 124 deps -= [ |
| 125 "//third_party/icu:icuuc", |
| 126 ] |
| 127 } |
87 } | 128 } |
88 } | 129 } |
OLD | NEW |