blob: 2f3678c7ca7d9289d3572fea097410495a65ddff [file] [log] [blame]
[email protected]c6f27f22013-08-21 21:44:591# 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
qsrfb5251d12015-01-21 15:57:225import("//testing/test.gni")
[email protected]847aaab82014-05-07 14:05:466
xunjieli905496a2015-08-31 15:51:177if (is_android) {
8 import("//build/config/android/rules.gni")
[email protected]847aaab82014-05-07 14:05:469}
10
xunjieli905496a2015-08-31 15:51:1711# Shared sources between url and url_lib_use_icu_alternatives_on_android.
12url_shared_sources = [
13 "gurl.cc",
14 "gurl.h",
15 "origin.cc",
16 "origin.h",
17 "scheme_host_port.cc",
18 "scheme_host_port.h",
19 "third_party/mozilla/url_parse.cc",
20 "third_party/mozilla/url_parse.h",
21 "url_canon.h",
22 "url_canon_etc.cc",
23 "url_canon_filesystemurl.cc",
24 "url_canon_fileurl.cc",
25 "url_canon_host.cc",
26 "url_canon_internal.cc",
27 "url_canon_internal.h",
28 "url_canon_internal_file.h",
29 "url_canon_ip.cc",
30 "url_canon_ip.h",
31 "url_canon_mailtourl.cc",
32 "url_canon_path.cc",
33 "url_canon_pathurl.cc",
34 "url_canon_query.cc",
35 "url_canon_relative.cc",
36 "url_canon_stdstring.cc",
37 "url_canon_stdstring.h",
38 "url_canon_stdurl.cc",
39 "url_constants.cc",
40 "url_constants.h",
41 "url_export.h",
42 "url_file.h",
43 "url_parse_file.cc",
44 "url_parse_internal.h",
45 "url_util.cc",
46 "url_util.h",
47]
48
[email protected]b5c19e32013-09-10 23:01:2549component("url") {
xunjieli905496a2015-08-31 15:51:1750 sources = url_shared_sources + [
51 "url_canon_icu.cc",
52 "url_canon_icu.h",
53 ]
54
[email protected]b5c19e32013-09-10 23:01:2555 if (is_win) {
56 # Don't conflict with Windows' "url.dll".
57 output_name = "url_lib"
58 }
[email protected]c6f27f22013-08-21 21:44:5959 defines = [ "URL_IMPLEMENTATION" ]
60
brettwd1c719a2015-02-19 23:17:0461 configs += [
brettwd1c719a2015-02-19 23:17:0462 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
63 "//build/config/compiler:no_size_t_to_int_warning",
64 ]
[email protected]fa8d1b62014-01-05 22:49:5065
[email protected]c6f27f22013-08-21 21:44:5966 deps = [
67 "//base",
[email protected]109875f2014-06-05 05:53:1468 "//base/third_party/dynamic_annotations",
[email protected]cc7ec692014-04-08 17:20:3869 "//third_party/icu",
agrieved7a71c882015-11-20 19:53:2870 "//third_party/icu:icudata",
[email protected]c6f27f22013-08-21 21:44:5971 ]
xunjieli905496a2015-08-31 15:51:1772}
[email protected]847aaab82014-05-07 14:05:4673
xunjieli905496a2015-08-31 15:51:1774if (is_android) {
75 generate_jni("url_jni_headers") {
76 sources = [
77 "android/java/src/org/chromium/url/IDNStringUtil.java",
[email protected]847aaab82014-05-07 14:05:4678 ]
xunjieli905496a2015-08-31 15:51:1779 jni_package = "url"
80 }
81
82 component("url_lib_use_icu_alternatives_on_android") {
83 sources = url_shared_sources + [
84 "android/url_jni_registrar.cc",
85 "android/url_jni_registrar.h",
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",
[email protected]847aaab82014-05-07 14:05:4693 ]
94
xunjieli905496a2015-08-31 15:51:1795 configs += [
96 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
97 "//build/config/compiler:no_size_t_to_int_warning",
98 ]
99
100 deps = [
101 ":url_jni_headers",
102 "//base",
103 "//base/third_party/dynamic_annotations",
[email protected]847aaab82014-05-07 14:05:46104 ]
105 }
[email protected]c6f27f22013-08-21 21:44:59106}
107
[email protected]5a8d5162014-04-12 01:19:16108# TODO(dpranke): crbug.com/360936. Get this to build and run on Android.
109if (!is_android) {
dpranke177c1e22015-07-22 23:07:43110 # TODO(GYP): Delete this after we've converted everything to GN.
111 # The _run targets exist only for compatibility w/ GYP.
112 group("url_unittests_run") {
113 testonly = true
114 deps = [
115 ":url_unittests",
116 ]
117 }
118
[email protected]5a8d5162014-04-12 01:19:16119 test("url_unittests") {
120 sources = [
121 "gurl_unittest.cc",
mkwst9f2cc892015-07-22 06:03:25122 "origin_unittest.cc",
mkwst28c7c112015-07-14 22:41:06123 "scheme_host_port_unittest.cc",
[email protected]847aaab82014-05-07 14:05:46124 "url_canon_icu_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16125 "url_canon_unittest.cc",
126 "url_parse_unittest.cc",
127 "url_test_utils.h",
128 "url_util_unittest.cc",
129 ]
[email protected]c6f27f22013-08-21 21:44:59130
brettwd1c719a2015-02-19 23:17:04131 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
132 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
133
[email protected]5a8d5162014-04-12 01:19:16134 #if (is_posix && !is_mac && !is_ios) {
[email protected]2fa89ef2014-05-07 18:45:59135 # if (use_allocator!="none") {
[email protected]5a8d5162014-04-12 01:19:16136 # deps += "//base/allocator"
137 # }
138 #}
[email protected]fa8d1b62014-01-05 22:49:50139
[email protected]5a8d5162014-04-12 01:19:16140 deps = [
141 ":url",
jamesr297949a2014-11-30 18:46:24142 "//base",
[email protected]5a8d5162014-04-12 01:19:16143 "//base/test:run_all_unittests",
144 "//testing/gtest",
145 "//third_party/icu:icuuc",
146 ]
147 }
[email protected]c6f27f22013-08-21 21:44:59148}