| 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 import("//testing/test.gni") | 5 import("//testing/test.gni") |
| 6 import("//url/config.gni") |
| 6 | 7 |
| 7 if (is_android) { | 8 # Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag. |
| 8 import("//build/config/android/rules.gni") | 9 config("url_icu_config") { |
| 10 if (use_icu_alternatives_on_android) { |
| 11 defines = [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ] |
| 12 } |
| 9 } | 13 } |
| 10 | 14 |
| 11 # Shared sources between url and url_lib_use_icu_alternatives_on_android. | |
| 12 url_shared_sources = [ | |
| 13 "android/url_jni_registrar.cc", | |
| 14 "android/url_jni_registrar.h", | |
| 15 "gurl.cc", | |
| 16 "gurl.h", | |
| 17 "origin.cc", | |
| 18 "origin.h", | |
| 19 "scheme_host_port.cc", | |
| 20 "scheme_host_port.h", | |
| 21 "third_party/mozilla/url_parse.cc", | |
| 22 "third_party/mozilla/url_parse.h", | |
| 23 "url_canon.h", | |
| 24 "url_canon_etc.cc", | |
| 25 "url_canon_filesystemurl.cc", | |
| 26 "url_canon_fileurl.cc", | |
| 27 "url_canon_host.cc", | |
| 28 "url_canon_internal.cc", | |
| 29 "url_canon_internal.h", | |
| 30 "url_canon_internal_file.h", | |
| 31 "url_canon_ip.cc", | |
| 32 "url_canon_ip.h", | |
| 33 "url_canon_mailtourl.cc", | |
| 34 "url_canon_path.cc", | |
| 35 "url_canon_pathurl.cc", | |
| 36 "url_canon_query.cc", | |
| 37 "url_canon_relative.cc", | |
| 38 "url_canon_stdstring.cc", | |
| 39 "url_canon_stdstring.h", | |
| 40 "url_canon_stdurl.cc", | |
| 41 "url_constants.cc", | |
| 42 "url_constants.h", | |
| 43 "url_export.h", | |
| 44 "url_file.h", | |
| 45 "url_parse_file.cc", | |
| 46 "url_parse_internal.h", | |
| 47 "url_util.cc", | |
| 48 "url_util.h", | |
| 49 ] | |
| 50 | |
| 51 component("url") { | 15 component("url") { |
| 52 sources = url_shared_sources + [ | |
| 53 "url_canon_icu.cc", | |
| 54 "url_canon_icu.h", | |
| 55 ] | |
| 56 | |
| 57 if (is_win) { | 16 if (is_win) { |
| 58 # Don't conflict with Windows' "url.dll". | 17 # Don't conflict with Windows' "url.dll". |
| 59 output_name = "url_lib" | 18 output_name = "url_lib" |
| 60 } | 19 } |
| 20 sources = [ |
| 21 "android/url_jni_registrar.cc", |
| 22 "android/url_jni_registrar.h", |
| 23 "gurl.cc", |
| 24 "gurl.h", |
| 25 "origin.cc", |
| 26 "origin.h", |
| 27 "scheme_host_port.cc", |
| 28 "scheme_host_port.h", |
| 29 "third_party/mozilla/url_parse.cc", |
| 30 "third_party/mozilla/url_parse.h", |
| 31 "url_canon.h", |
| 32 "url_canon_etc.cc", |
| 33 "url_canon_filesystemurl.cc", |
| 34 "url_canon_fileurl.cc", |
| 35 "url_canon_host.cc", |
| 36 "url_canon_icu.cc", |
| 37 "url_canon_icu.h", |
| 38 "url_canon_internal.cc", |
| 39 "url_canon_internal.h", |
| 40 "url_canon_internal_file.h", |
| 41 "url_canon_ip.cc", |
| 42 "url_canon_ip.h", |
| 43 "url_canon_mailtourl.cc", |
| 44 "url_canon_path.cc", |
| 45 "url_canon_pathurl.cc", |
| 46 "url_canon_query.cc", |
| 47 "url_canon_relative.cc", |
| 48 "url_canon_stdstring.cc", |
| 49 "url_canon_stdstring.h", |
| 50 "url_canon_stdurl.cc", |
| 51 "url_constants.cc", |
| 52 "url_constants.h", |
| 53 "url_export.h", |
| 54 "url_file.h", |
| 55 "url_parse_file.cc", |
| 56 "url_parse_internal.h", |
| 57 "url_util.cc", |
| 58 "url_util.h", |
| 59 ] |
| 60 |
| 61 defines = [ "URL_IMPLEMENTATION" ] | 61 defines = [ "URL_IMPLEMENTATION" ] |
| 62 | 62 |
| 63 configs += [ | 63 configs += [ |
| 64 ":url_icu_config", |
| 65 |
| 64 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 66 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 65 "//build/config/compiler:no_size_t_to_int_warning", | 67 "//build/config/compiler:no_size_t_to_int_warning", |
| 66 ] | 68 ] |
| 67 | 69 |
| 68 deps = [ | 70 deps = [ |
| 69 "//base", | 71 "//base", |
| 70 "//base/third_party/dynamic_annotations", | 72 "//base/third_party/dynamic_annotations", |
| 71 "//third_party/icu:icudata", | 73 "//third_party/icu:icudata", |
| 72 "//third_party/icu", | 74 "//third_party/icu", |
| 73 ] | 75 ] |
| 74 } | |
| 75 | 76 |
| 76 if (is_android) { | 77 if (use_icu_alternatives_on_android) { |
| 77 generate_jni("url_jni_headers") { | 78 sources -= [ |
| 78 sources = [ | 79 "url_canon_icu.cc", |
| 79 "android/java/src/org/chromium/url/IDNStringUtil.java", | 80 "url_canon_icu.h", |
| 80 ] | 81 ] |
| 81 jni_package = "url" | 82 deps -= [ |
| 82 } | 83 "//third_party/icu:icudata", |
| 83 | 84 "//third_party/icu", |
| 84 component("url_lib_use_icu_alternatives_on_android") { | |
| 85 sources = url_shared_sources + [ | |
| 86 "url_canon_icu_alternatives_android.cc", | |
| 87 "url_canon_icu_alternatives_android.h", | |
| 88 ] | |
| 89 | |
| 90 defines = [ | |
| 91 "URL_IMPLEMENTATION", | |
| 92 "USE_ICU_ALTERNATIVES_ON_ANDROID=1", | |
| 93 ] | 85 ] |
| 94 | 86 |
| 95 configs += [ | 87 sources += [ |
| 96 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 88 "url_canon_icu_alternatives_android.cc", |
| 97 "//build/config/compiler:no_size_t_to_int_warning", | 89 "url_canon_icu_alternatives_android.h", |
| 98 ] | |
| 99 | |
| 100 deps = [ | |
| 101 ":url_jni_headers", | |
| 102 "//base", | |
| 103 "//base/third_party/dynamic_annotations", | |
| 104 ] | 90 ] |
| 105 } | 91 } |
| 106 } | 92 } |
| 107 | 93 |
| 108 # TODO(dpranke): crbug.com/360936. Get this to build and run on Android. | 94 # TODO(dpranke): crbug.com/360936. Get this to build and run on Android. |
| 109 if (!is_android) { | 95 if (!is_android) { |
| 110 # TODO(GYP): Delete this after we've converted everything to GN. | 96 # TODO(GYP): Delete this after we've converted everything to GN. |
| 111 # The _run targets exist only for compatibility w/ GYP. | 97 # The _run targets exist only for compatibility w/ GYP. |
| 112 group("url_unittests_run") { | 98 group("url_unittests_run") { |
| 113 testonly = true | 99 testonly = true |
| (...skipping 23 matching lines...) Expand all Loading... |
| 137 # } | 123 # } |
| 138 #} | 124 #} |
| 139 | 125 |
| 140 deps = [ | 126 deps = [ |
| 141 ":url", | 127 ":url", |
| 142 "//base", | 128 "//base", |
| 143 "//base/test:run_all_unittests", | 129 "//base/test:run_all_unittests", |
| 144 "//testing/gtest", | 130 "//testing/gtest", |
| 145 "//third_party/icu:icuuc", | 131 "//third_party/icu:icuuc", |
| 146 ] | 132 ] |
| 133 |
| 134 if (use_icu_alternatives_on_android) { |
| 135 sources -= [ "url_canon_icu_unittest.cc" ] |
| 136 deps -= [ "//third_party/icu:icuuc" ] |
| 137 } |
| 147 } | 138 } |
| 148 } | 139 } |
| OLD | NEW |