Refactor the way enhanced bookmark gets large icons
[chromium-blink-merge.git] / url / BUILD.gn
blobd5ea067bc3d17ee25c134f3646573cccd883ba3f
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.
5 import("//testing/test.gni")
6 import("//url/config.gni")
8 # Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag.
9 config("url_icu_config") {
10   if (use_icu_alternatives_on_android) {
11     defines = [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ]
12   }
15 component("url") {
16   if (is_win) {
17     # Don't conflict with Windows' "url.dll".
18     output_name = "url_lib"
19   }
20   sources = [
21     "android/url_jni_registrar.cc",
22     "android/url_jni_registrar.h",
23     "deprecated_serialized_origin.cc",
24     "deprecated_serialized_origin.h",
25     "gurl.cc",
26     "gurl.h",
27     "origin.cc",
28     "origin.h",
29     "scheme_host_port.cc",
30     "scheme_host_port.h",
31     "third_party/mozilla/url_parse.cc",
32     "third_party/mozilla/url_parse.h",
33     "url_canon.h",
34     "url_canon_etc.cc",
35     "url_canon_filesystemurl.cc",
36     "url_canon_fileurl.cc",
37     "url_canon_host.cc",
38     "url_canon_icu.cc",
39     "url_canon_icu.h",
40     "url_canon_internal.cc",
41     "url_canon_internal.h",
42     "url_canon_internal_file.h",
43     "url_canon_ip.cc",
44     "url_canon_ip.h",
45     "url_canon_mailtourl.cc",
46     "url_canon_path.cc",
47     "url_canon_pathurl.cc",
48     "url_canon_query.cc",
49     "url_canon_relative.cc",
50     "url_canon_stdstring.cc",
51     "url_canon_stdstring.h",
52     "url_canon_stdurl.cc",
53     "url_constants.cc",
54     "url_constants.h",
55     "url_export.h",
56     "url_file.h",
57     "url_parse_file.cc",
58     "url_parse_internal.h",
59     "url_util.cc",
60     "url_util.h",
61   ]
63   defines = [ "URL_IMPLEMENTATION" ]
65   configs += [
66     ":url_icu_config",
68     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
69     "//build/config/compiler:no_size_t_to_int_warning",
70   ]
72   deps = [
73     "//base",
74     "//base/third_party/dynamic_annotations",
75     "//third_party/icu:icudata",
76     "//third_party/icu",
77   ]
79   if (use_icu_alternatives_on_android) {
80     sources -= [
81       "url_canon_icu.cc",
82       "url_canon_icu.h",
83     ]
84     deps -= [
85       "//third_party/icu:icudata",
86       "//third_party/icu",
87     ]
89     sources += [
90       "url_canon_icu_alternatives_android.cc",
91       "url_canon_icu_alternatives_android.h",
92     ]
93   }
96 # TODO(dpranke): crbug.com/360936. Get this to build and run on Android.
97 if (!is_android) {
98   # TODO(GYP): Delete this after we've converted everything to GN.
99   # The _run targets exist only for compatibility w/ GYP.
100   group("url_unittests_run") {
101     testonly = true
102     deps = [
103       ":url_unittests",
104     ]
105   }
107   test("url_unittests") {
108     sources = [
109       "deprecated_serialized_origin_unittest.cc",
110       "gurl_unittest.cc",
111       "origin_unittest.cc",
112       "scheme_host_port_unittest.cc",
113       "url_canon_icu_unittest.cc",
114       "url_canon_unittest.cc",
115       "url_parse_unittest.cc",
116       "url_test_utils.h",
117       "url_util_unittest.cc",
118     ]
120     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
121     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
123     #if (is_posix && !is_mac && !is_ios) {
124     #  if (use_allocator!="none") {
125     #    deps += "//base/allocator"
126     #  }
127     #}
129     deps = [
130       ":url",
131       "//base",
132       "//base/test:run_all_unittests",
133       "//testing/gtest",
134       "//third_party/icu:icuuc",
135     ]
137     if (use_icu_alternatives_on_android) {
138       sources -= [ "url_canon_icu_unittest.cc" ]
139       deps -= [ "//third_party/icu:icuuc" ]
140     }
141   }