Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / views / BUILD.gn
blob765b467cb9541c4f8619433cfa6763918d32376c
1 # Copyright 2014 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("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10                           [ rebase_path("views.gyp") ],
11                           "scope",
12                           [ "views.gyp" ])
14 component("views") {
15   sources = gypi_values.views_sources
17   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
18   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
20   defines = [ "VIEWS_IMPLEMENTATION" ]
22   deps = [
23     "//base:i18n",
24     "//base/third_party/dynamic_annotations",
25     "//skia",
26     "//third_party/icu",
27     "//ui/accessibility",
28     "//ui/native_theme",
29     "//ui/resources",
30     "//ui/strings",
31     "//url",
32   ]
34   public_deps = [
35     "//base",
36     "//ui/accessibility:ax_gen",
37     "//ui/base",
38     "//ui/base/ime",
39     "//ui/compositor",
40     "//ui/events",
41     "//ui/events:events_base",
42     "//ui/events/platform",
43     "//ui/gfx",
44     "//ui/gfx/geometry",
45   ]
47   if (use_x11 && !is_chromeos) {
48     deps += [ "//ui/display/util" ]
49   }
50   if (is_linux && !is_chromeos) {
51     sources -= [ "window/window_button_order_provider.cc" ]
52     deps += [ "//ui/shell_dialogs" ]
53   } else {
54     sources -= [
55       "linux_ui/linux_ui.cc",
56       "linux_ui/linux_ui.h",
57       "linux_ui/window_button_order_observer.h",
58       "linux_ui/window_button_order_provider.cc",
59     ]
60   }
62   if (is_chromeos) {
63     sources -= [
64       "linux_ui/status_icon_linux.cc",
65       "linux_ui/status_icon_linux.h",
66     ]
67   }
69   if (is_win) {
70     sources += gypi_values.views_win_sources
71     libs = [
72       "dwmapi.lib",
73       "imm32.lib",
74       "oleacc.lib",
75     ]
76     ldflags = [ "/DELAYLOAD:user32.dll" ]
77     deps += [
78       "//third_party/iaccessible2",
79       "//third_party/wtl",
80     ]
81   }
83   if (use_ozone) {
84     deps += [ "//ui/ozone" ]
85   }
86   if (use_x11) {
87     configs += [
88       "//build/config/linux:x11",
89       "//build/config/linux:xrandr",
90     ]
91     deps += [
92       "//ui/events/devices",
93       "//ui/events/platform/x11",
94       "//ui/gfx/x",
95     ]
96   }
98   if (use_aura) {
99     sources += gypi_values.views_aura_sources
100     deps += [
101       "//ui/aura",
102       "//ui/wm",
103     ]
104     if (!is_chromeos) {
105       sources += gypi_values.views_desktop_aura_sources
106       if (use_x11) {
107         sources += gypi_values.views_desktop_aura_x11_sources
108         configs += [ "//build/config/linux:atk" ]
109       } else if (is_win) {
110         sources += gypi_values.views_desktop_aura_win_sources
111       } else if (use_ozone) {
112         sources += gypi_values.views_desktop_aura_ozone_sources
113       }
114       if (is_linux) {
115         sources += gypi_values.views_desktop_aura_linux_sources
116       }
117     }
118   }
120   if (is_mac) {
121     deps += [ "//ui/accelerated_widget_mac" ]
122     libs = [
123       # Required by bridged_native_widget.mm.
124       "QuartzCore.framework",
125     ]
126   }
129 static_library("test_support") {
130   testonly = true
131   sources = gypi_values.views_test_support_sources
133   public_deps = [
134     ":views",
135   ]
136   deps = [
137     "//base",
138     "//ipc:test_support",
139     "//skia",
140     "//testing/gtest",
141     "//ui/base",
142     "//ui/base/ime",
143     "//ui/compositor",
144     "//ui/compositor:test_support",
145     "//ui/events",
146     "//ui/events:events_base",
147     "//ui/events:test_support",
148     "//ui/events/platform",
149     "//ui/gfx",
150     "//ui/gfx/geometry",
151   ]
153   if (use_aura) {
154     sources += gypi_values.views_test_support_aura_sources
155     deps += [
156       "//ui/aura",
157       "//ui/aura:test_support",
158       "//ui/wm",
159     ]
160     if (use_x11 && !is_chromeos) {
161       sources += gypi_values.views_test_support_desktop_aura_x11_sources
162     }
163   }
164   if (use_x11) {
165     deps += [ "//ui/gfx/x" ]
166   }
167   if (use_ozone || !use_x11) {
168     sources -= [ "test/x11_property_change_waiter.cc" ]
169   }
172 test("views_unittests") {
173   sources = gypi_values.views_unittests_sources
175   deps = [
176     ":test_support",
177     "//base",
178     "//base:i18n",
179     "//base/allocator",
180     "//base/test:test_support",
181     "//skia",
182     "//testing/gtest",
183     "//third_party/icu",
184     "//ui/accessibility",
185     "//ui/base",
186     "//ui/base/ime",
187     "//ui/base:test_support",
188     "//ui/compositor:test_support",
189     "//ui/events:test_support",
190     "//ui/events:events_base",
191     "//ui/events/platform",
192     "//ui/gfx",
193     "//ui/gfx/geometry",
194     "//ui/gl",
195     "//ui/resources",
196     "//ui/strings",
197     "//url",
198   ]
200   if (is_win) {
201     deps += [
202       "//third_party/iaccessible2",
203       "//third_party/wtl",
204     ]
205     libs = [
206       "imm32.lib",
207       "oleacc.lib",
208       "comctl32.lib",
209     ]
211     # TOOD(GYP)
212     #'msvs_settings': {
213     #  'VCManifestTool': {
214     #    'AdditionalManifestFiles': [
215     #      '$(ProjectDir)\\test\\views_unittest.manifest',
216     #    ],
217     #  },
218     #},
219   }
221   if (use_x11) {
222     configs += [
223       "//build/config/linux:x11",
224       "//build/config/linux:xext",
225     ]
226     deps += [
227       "//ui/events/devices",
228       "//ui/events/platform/x11",
229       "//ui/gfx/x",
230     ]
231   }
233   if (use_aura) {
234     sources += gypi_values.views_unittests_aura_sources
235     deps += [
236       "//ui/aura",
237       "//ui/aura:test_support",
238       "//ui/wm",
239     ]
240     if (!is_chromeos) {
241       sources += gypi_values.views_unittests_desktop_aura_sources
242       if (use_x11) {
243         sources += gypi_values.views_unittests_desktop_aurax11_sources
244       }
245     }
246   }
247   if (!is_chromeos) {
248     sources += gypi_values.views_unittests_desktop_sources
249   }
250   if (use_x11) {
251     deps += [
252       "//ui/events/platform/x11",
253       "//ui/gfx/x",
254     ]
255   }
257   if (is_mac) {
258     # views_unittests not yet compiling on Mac. http://crbug.com/378134
259     sources -= [
260       "bubble/bubble_window_targeter_unittest.cc",
261       "controls/button/custom_button_unittest.cc",
262       "controls/button/menu_button_unittest.cc",
263       "controls/menu/menu_controller_unittest.cc",
264       "controls/native/native_view_host_unittest.cc",
265       "focus/focus_manager_unittest.cc",
266       "ime/input_method_bridge_unittest.cc",
267       "widget/widget_unittest.cc",
268       "widget/window_reorderer_unittest.cc",
269     ]
270   }
273 if (is_mac) {
274   test("macviews_interactive_ui_tests") {
275     sources = [
276       "cocoa/bridged_native_widget_interactive_uitest.mm",
277       "run_all_unittests.cc",
278       "widget/native_widget_mac_interactive_uitest.mm",
279     ]
280     deps = [
281       ":test_support",
282       ":views",
283       "//base",
284       "//base/test:test_support",
285       "//skia",
286       "//testing/gtest",
287       "//ui/compositor",
288       "//ui/resources",
289       "//ui/resources:ui_test_pak",
290       "//ui/strings",
291     ]
292   }