[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 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 | |
[email protected] | b5c19e3 | 2013-09-10 23:01:25 | [diff] [blame] | 17 | component("url") { |
[email protected] | b5c19e3 | 2013-09-10 23:01:25 | [diff] [blame] | 18 | if (is_win) { |
| 19 | # Don't conflict with Windows' "url.dll". |
| 20 | output_name = "url_lib" |
| 21 | } |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 22 | sources = [ |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 23 | "android/url_jni_registrar.cc", |
| 24 | "android/url_jni_registrar.h", |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 25 | "gurl.cc", |
| 26 | "gurl.h", |
| 27 | "third_party/mozilla/url_parse.cc", |
| 28 | "third_party/mozilla/url_parse.h", |
| 29 | "url_canon.h", |
| 30 | "url_canon_etc.cc", |
| 31 | "url_canon_filesystemurl.cc", |
| 32 | "url_canon_fileurl.cc", |
| 33 | "url_canon_host.cc", |
| 34 | "url_canon_icu.cc", |
| 35 | "url_canon_icu.h", |
| 36 | "url_canon_internal.cc", |
| 37 | "url_canon_internal.h", |
| 38 | "url_canon_internal_file.h", |
| 39 | "url_canon_ip.cc", |
| 40 | "url_canon_ip.h", |
| 41 | "url_canon_mailtourl.cc", |
| 42 | "url_canon_path.cc", |
| 43 | "url_canon_pathurl.cc", |
| 44 | "url_canon_query.cc", |
| 45 | "url_canon_relative.cc", |
[email protected] | 5483752 | 2013-12-21 17:56:38 | [diff] [blame] | 46 | "url_canon_stdstring.cc", |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 47 | "url_canon_stdstring.h", |
| 48 | "url_canon_stdurl.cc", |
[email protected] | e8ca69c | 2014-05-07 15:31:19 | [diff] [blame^] | 49 | "url_constants.cc", |
| 50 | "url_constants.h", |
[email protected] | fa8d1b6 | 2014-01-05 22:49:50 | [diff] [blame] | 51 | "url_export.h", |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 52 | "url_file.h", |
| 53 | "url_parse_file.cc", |
| 54 | "url_parse_internal.h", |
| 55 | "url_util.cc", |
| 56 | "url_util.h", |
| 57 | ] |
| 58 | |
| 59 | defines = [ "URL_IMPLEMENTATION" ] |
| 60 | |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 61 | configs += [ ":url_icu_config" ] |
| 62 | |
[email protected] | fa8d1b6 | 2014-01-05 22:49:50 | [diff] [blame] | 63 | # if (is_win) { |
| 64 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 65 | # 'msvs_disabled_warnings': [ 4267, ] |
| 66 | # } |
| 67 | |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 68 | deps = [ |
| 69 | "//base", |
| 70 | "//third_party/icu:icudata", |
[email protected] | cc7ec69 | 2014-04-08 17:20:38 | [diff] [blame] | 71 | "//third_party/icu", |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 72 | ] |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 73 | |
| 74 | if (use_icu_alternatives_on_android) { |
| 75 | sources -= [ |
| 76 | "url_canon_icu.cc", |
| 77 | "url_canon_icu.h", |
| 78 | ] |
| 79 | deps -= [ |
| 80 | "//third_party/icu:icudata", |
| 81 | "//third_party/icu", |
| 82 | ] |
| 83 | |
| 84 | sources += [ |
| 85 | "url_canon_icu_alternatives_android.cc", |
| 86 | "url_canon_icu_alternatives_android.h", |
| 87 | ] |
| 88 | } |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 89 | } |
| 90 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 91 | # TODO(dpranke): crbug.com/360936. Get this to build and run on Android. |
| 92 | if (!is_android) { |
| 93 | test("url_unittests") { |
| 94 | sources = [ |
| 95 | "gurl_unittest.cc", |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 96 | "url_canon_icu_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 97 | "url_canon_unittest.cc", |
| 98 | "url_parse_unittest.cc", |
| 99 | "url_test_utils.h", |
| 100 | "url_util_unittest.cc", |
| 101 | ] |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 102 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 103 | #if (is_posix && !is_mac && !is_ios) { |
| 104 | # # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554 |
| 105 | # if ((use_allocator!="none" && use_allocator!="see_use_tcmalloc") || (use_allocator=="see_use_tcmalloc" && linux_use_tcmalloc) { |
| 106 | # deps += "//base/allocator" |
| 107 | # } |
| 108 | #} |
[email protected] | fa8d1b6 | 2014-01-05 22:49:50 | [diff] [blame] | 109 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 110 | # if (is_win) { |
| 111 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 112 | # 'msvs_disabled_warnings': [ 4267, ] |
| 113 | # } |
[email protected] | fa8d1b6 | 2014-01-05 22:49:50 | [diff] [blame] | 114 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 115 | deps = [ |
| 116 | ":url", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 117 | "//base/test:run_all_unittests", |
| 118 | "//testing/gtest", |
| 119 | "//third_party/icu:icuuc", |
| 120 | ] |
[email protected] | 847aaab8 | 2014-05-07 14:05:46 | [diff] [blame] | 121 | |
| 122 | if (use_icu_alternatives_on_android) { |
| 123 | sources -= [ |
| 124 | "url_canon_icu_unittest.cc", |
| 125 | ] |
| 126 | deps -= [ |
| 127 | "//third_party/icu:icuuc", |
| 128 | ] |
| 129 | } |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 130 | } |
[email protected] | c6f27f2 | 2013-08-21 21:44:59 | [diff] [blame] | 131 | } |