blob: 03e90cb3fff083757c979c0cc9630e69337fefa0 [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]85191ed2014-05-15 00:41:496import("//url/config.gni")
[email protected]847aaab82014-05-07 14:05:467
8# Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag.
9config("url_icu_config") {
10 if (use_icu_alternatives_on_android) {
11 defines = [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ]
12 }
13}
14
[email protected]b5c19e32013-09-10 23:01:2515component("url") {
[email protected]b5c19e32013-09-10 23:01:2516 if (is_win) {
17 # Don't conflict with Windows' "url.dll".
18 output_name = "url_lib"
19 }
[email protected]c6f27f22013-08-21 21:44:5920 sources = [
[email protected]847aaab82014-05-07 14:05:4621 "android/url_jni_registrar.cc",
22 "android/url_jni_registrar.h",
[email protected]c6f27f22013-08-21 21:44:5923 "gurl.cc",
24 "gurl.h",
[email protected]8a3f8242014-06-05 18:05:1225 "origin.cc",
26 "origin.h",
[email protected]c6f27f22013-08-21 21:44:5927 "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]54837522013-12-21 17:56:3846 "url_canon_stdstring.cc",
[email protected]c6f27f22013-08-21 21:44:5947 "url_canon_stdstring.h",
48 "url_canon_stdurl.cc",
[email protected]e8ca69c2014-05-07 15:31:1949 "url_constants.cc",
50 "url_constants.h",
[email protected]fa8d1b62014-01-05 22:49:5051 "url_export.h",
[email protected]c6f27f22013-08-21 21:44:5952 "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]847aaab82014-05-07 14:05:4661 configs += [ ":url_icu_config" ]
62
[email protected]aa9815662014-06-13 16:29:0163 if (is_win) {
scottmg34fb7e52014-12-03 23:27:2464 cflags = [ "/wd4267" ] # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
[email protected]aa9815662014-06-13 16:29:0165 }
[email protected]fa8d1b62014-01-05 22:49:5066
[email protected]c6f27f22013-08-21 21:44:5967 deps = [
68 "//base",
[email protected]109875f2014-06-05 05:53:1469 "//base/third_party/dynamic_annotations",
[email protected]c6f27f22013-08-21 21:44:5970 "//third_party/icu:icudata",
[email protected]cc7ec692014-04-08 17:20:3871 "//third_party/icu",
[email protected]c6f27f22013-08-21 21:44:5972 ]
[email protected]847aaab82014-05-07 14:05:4673
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]c6f27f22013-08-21 21:44:5989}
90
[email protected]5a8d5162014-04-12 01:19:1691# TODO(dpranke): crbug.com/360936. Get this to build and run on Android.
92if (!is_android) {
93 test("url_unittests") {
94 sources = [
95 "gurl_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:1296 "origin_unittest.cc",
[email protected]847aaab82014-05-07 14:05:4697 "url_canon_icu_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:1698 "url_canon_unittest.cc",
99 "url_parse_unittest.cc",
100 "url_test_utils.h",
101 "url_util_unittest.cc",
102 ]
[email protected]c6f27f22013-08-21 21:44:59103
[email protected]5a8d5162014-04-12 01:19:16104 #if (is_posix && !is_mac && !is_ios) {
[email protected]2fa89ef2014-05-07 18:45:59105 # if (use_allocator!="none") {
[email protected]5a8d5162014-04-12 01:19:16106 # deps += "//base/allocator"
107 # }
108 #}
[email protected]fa8d1b62014-01-05 22:49:50109
[email protected]aa9815662014-06-13 16:29:01110 if (is_win) {
111 cflags = [
112 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
113 "/wd4267",
114 ]
115 }
[email protected]fa8d1b62014-01-05 22:49:50116
[email protected]5a8d5162014-04-12 01:19:16117 deps = [
118 ":url",
jamesr297949a2014-11-30 18:46:24119 "//base",
[email protected]5a8d5162014-04-12 01:19:16120 "//base/test:run_all_unittests",
121 "//testing/gtest",
122 "//third_party/icu:icuuc",
123 ]
[email protected]847aaab82014-05-07 14:05:46124
125 if (use_icu_alternatives_on_android) {
scottmg34fb7e52014-12-03 23:27:24126 sources -= [ "url_canon_icu_unittest.cc" ]
127 deps -= [ "//third_party/icu:icuuc" ]
[email protected]847aaab82014-05-07 14:05:46128 }
[email protected]5a8d5162014-04-12 01:19:16129 }
[email protected]c6f27f22013-08-21 21:44:59130}