Revert of Output closure-compiled JavaScript files (patchset #10 id:180001 of https...
[chromium-blink-merge.git] / ui / views / BUILD.gn
blob922ce0c066c66ea9f95f3161415ed05b7a836dd4
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/aura",
29     "//ui/native_theme",
30     "//ui/resources",
31     "//ui/strings",
32     "//ui/wm",
33     "//url",
34   ]
36   public_deps = [
37     "//base",
38     "//ui/accessibility:ax_gen",
39     "//ui/base",
40     "//ui/base/ime",
41     "//ui/compositor",
42     "//ui/events",
43     "//ui/events:events_base",
44     "//ui/events/platform",
45     "//ui/gfx",
46     "//ui/gfx/geometry",
47   ]
49   if (use_x11 && !is_chromeos) {
50     deps += [ "//ui/display/util" ]
51   }
52   if (is_linux && !is_chromeos) {
53     sources -= [ "window/window_button_order_provider.cc" ]
54     deps += [ "//ui/shell_dialogs" ]
55   } else {
56     sources -= [
57       "linux_ui/linux_ui.cc",
58       "linux_ui/linux_ui.h",
59       "linux_ui/window_button_order_observer.h",
60       "linux_ui/window_button_order_provider.cc",
61     ]
62   }
64   if (is_chromeos) {
65     sources -= [
66       "linux_ui/status_icon_linux.cc",
67       "linux_ui/status_icon_linux.h",
68     ]
69   }
71   if (is_win) {
72     sources += gypi_values.views_win_sources
73     libs = [
74       "imm32.lib",
75       "oleacc.lib",
76     ]
77     ldflags = [ "/DELAYLOAD:user32.dll" ]
78     deps += [
79       "//third_party/iaccessible2",
80       "//third_party/wtl",
81     ]
82   }
84   if (use_ozone) {
85     deps += [ "//ui/ozone" ]
86   }
87   if (use_x11) {
88     configs += [
89       "//build/config/linux:x11",
90       "//build/config/linux:xrandr",
91     ]
92     deps += [
93       "//ui/events/devices",
94       "//ui/events/platform/x11",
95       "//ui/gfx/x",
96     ]
97   }
99   if (use_aura) {
100     sources += gypi_values.views_aura_sources
101     if (!is_chromeos) {
102       sources += gypi_values.views_desktop_aura_sources
103       if (use_x11) {
104         sources += gypi_values.views_desktop_aura_x11_sources
105       } else if (is_win) {
106         sources += gypi_values.views_desktop_aura_win_sources
107       } else if (use_ozone) {
108         sources += gypi_values.views_desktop_aura_ozone_sources
109       }
110       if (is_linux) {
111         sources += gypi_values.views_desktop_aura_linux_sources
112       }
113     }
114   }
116   if (is_mac) {
117     deps += [ "//ui/accelerated_widget_mac" ]
118   }
121 static_library("test_support") {
122   testonly = true
123   sources = gypi_values.views_test_support_sources
125   public_deps = [
126     ":views",
127   ]
128   deps = [
129     "//base",
130     "//ipc:test_support",
131     "//skia",
132     "//testing/gtest",
133     "//ui/aura",
134     "//ui/base",
135     "//ui/base/ime",
136     "//ui/compositor",
137     "//ui/compositor:test_support",
138     "//ui/events",
139     "//ui/events:events_base",
140     "//ui/events:test_support",
141     "//ui/events/platform",
142     "//ui/gfx",
143     "//ui/gfx/geometry",
144     "//ui/wm",
145   ]
147   if (is_chromeos || !use_x11) {
148     sources -= [
149       "test/ui_controls_factory_desktop_aurax11.cc",
150       "test/ui_controls_factory_desktop_aurax11.h",
151     ]
152   }
153   if (use_aura) {
154     sources += gypi_values.views_test_support_aura_sources
155     deps += [ "//ui/aura:test_support" ]
156   }
157   if (use_x11) {
158     deps += [ "//ui/gfx/x" ]
159   }
160   if (use_ozone || !use_x11) {
161     sources -= [ "test/x11_property_change_waiter.cc" ]
162   }
165 test("views_unittests") {
166   sources = gypi_values.views_unittests_sources
168   deps = [
169     ":test_support",
170     "//base",
171     "//base:i18n",
172     "//base/allocator",
173     "//base/test:test_support",
174     "//skia",
175     "//testing/gtest",
176     "//third_party/icu",
177     "//ui/accessibility",
178     "//ui/aura",
179     "//ui/base",
180     "//ui/base/ime",
181     "//ui/base:test_support",
182     "//ui/compositor:test_support",
183     "//ui/events:test_support",
184     "//ui/events:events_base",
185     "//ui/events/platform",
186     "//ui/gfx",
187     "//ui/gfx/geometry",
188     "//ui/gl",
189     "//ui/resources",
190     "//ui/strings",
191     "//ui/wm",
192     "//url",
193   ]
195   if (is_win) {
196     deps += [
197       "//third_party/iaccessible2",
198       "//third_party/wtl",
199     ]
200     libs = [
201       "imm32.lib",
202       "oleacc.lib",
203       "comctl32.lib",
204     ]
206     # TOOD(GYP)
207     #'msvs_settings': {
208     #  'VCManifestTool': {
209     #    'AdditionalManifestFiles': [
210     #      '$(ProjectDir)\\test\\views_unittest.manifest',
211     #    ],
212     #  },
213     #},
214   }
216   if (use_x11) {
217     configs += [
218       "//build/config/linux:x11",
219       "//build/config/linux:xext",
220     ]
221     deps += [
222       "//ui/events/devices",
223       "//ui/events/platform/x11",
224       "//ui/gfx/x",
225     ]
226   }
228   if (use_aura) {
229     sources += gypi_values.views_unittests_aura_sources
230     deps += [ "//ui/aura:test_support" ]
231     if (!is_chromeos) {
232       sources += gypi_values.views_unittests_desktop_aura_sources
233       if (use_x11) {
234         sources += gypi_values.views_unittests_desktop_aurax11_sources
235       }
236     }
237   }
238   if (!is_chromeos) {
239     sources += gypi_values.views_unittests_desktop_sources
240   }
241   if (use_x11) {
242     deps += [
243       "//ui/events/platform/x11",
244       "//ui/gfx/x",
245     ]
246   }
248   if (is_mac) {
249     # views_unittests not yet compiling on Mac. http://crbug.com/378134
250     sources -= [
251       "bubble/bubble_window_targeter_unittest.cc",
252       "controls/button/custom_button_unittest.cc",
253       "controls/button/menu_button_unittest.cc",
254       "controls/menu/menu_controller_unittest.cc",
255       "controls/native/native_view_host_unittest.cc",
256       "focus/focus_manager_unittest.cc",
257       "ime/input_method_bridge_unittest.cc",
258       "widget/widget_unittest.cc",
259       "widget/window_reorderer_unittest.cc",
260     ]
261   }
264 if (is_mac) {
265   test("macviews_interactive_ui_tests") {
266     sources = [
267       "cocoa/bridged_native_widget_interactive_uitest.mm",
268       "run_all_unittests.cc",
269       "widget/native_widget_mac_interactive_uitest.mm",
270     ]
271     deps = [
272       ":test_support",
273       ":views",
274       "//base",
275       "//base/test:test_support",
276       "//skia",
277       "//testing/gtest",
278       "//ui/aura",
279       "//ui/compositor",
280       "//ui/resources",
281       "//ui/resources:ui_test_pak",
282       "//ui/strings",
283       "//ui/wm",
284     ]
285   }