iOS factories for AboutSigninInternals and AccountReconcilor
[chromium-blink-merge.git] / ash / BUILD.gn
blob9a10e271b42485f33a55c02718bafe873f882f70
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("ash.gyp") ],
11                           "scope",
12                           [ "ash.gyp" ])
14 component("ash") {
15   sources = gypi_values.ash_sources
17   configs += [ "//build/config:precompiled_headers" ]
18   defines = [ "ASH_IMPLEMENTATION" ]
20   public_deps = [
21     "//ash/resources",
22     "//ash/strings",
23   ]
24   deps = [
25     "//base",
26     "//base:i18n",
27     "//base/third_party/dynamic_annotations",
28     "//cc",
29     "//components/device_event_log",
30     "//components/user_manager",
31     "//components/wallpaper",
32     "//content/public/browser",
33     "//media",
34     "//net",
35     "//skia",
36     "//third_party/icu",
37     "//ui/accessibility",
38     "//ui/app_list",
39     "//ui/aura",
40     "//ui/base",
41     "//ui/base/ime",
42     "//ui/compositor",
43     "//ui/events",
44     "//ui/events:events_base",
45     "//ui/events:gesture_detection",
46     "//ui/events/devices",
47     "//ui/gfx",
48     "//ui/gfx/geometry",
49     "//ui/keyboard",
50     "//ui/message_center",
51     "//ui/resources",
52     "//ui/strings",
53     "//ui/views",
54     "//ui/views/controls/webview",
55     "//ui/web_dialogs",
56     "//ui/wm",
57     "//url",
58   ]
60   if (is_win) {
61     sources -= [
62       "sticky_keys/sticky_keys_controller.cc",
63       "sticky_keys/sticky_keys_controller.h",
64     ]
66     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
67     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
68   }
70   if (use_x11) {
71     configs += [
72       "//build/config/linux:x11",
73       "//build/config/linux:xfixes",
74     ]
75     deps += [
76       "//ui/events/platform",
77       "//ui/gfx/x",
78     ]
79   } else {
80     sources -= [
81       "host/ash_window_tree_host_x11.cc",
82       "host/ash_window_tree_host_x11.h",
83       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc",
84       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h",
85     ]
86   }
88   if (use_ozone) {
89     deps += [
90       "//ui/events/ozone:events_ozone",
91       "//ui/ozone",
92     ]
93   }
95   if (is_chromeos) {
96     deps += [
97       "//device/bluetooth",
98       "//ui/display",
99       "//ui/display/util",
100       "//chromeos",
101       "//chromeos:power_manager_proto",
102       "//third_party/qcms",
103       "//ui/chromeos/resources",
104       "//ui/chromeos/strings",
105       "//ui/chromeos:ui_chromeos",
106     ]
107   } else {
108     sources -= [
109       "accelerators/key_hold_detector.cc",
110       "accelerators/key_hold_detector.h",
111       "accelerators/magnifier_key_scroller.cc",
112       "accelerators/magnifier_key_scroller.h",
113       "accelerators/spoken_feedback_toggler.cc",
114       "accelerators/spoken_feedback_toggler.h",
115       "display/display_configurator_animation.cc",
116       "display/display_configurator_animation.h",
117       "display/resolution_notification_controller.cc",
118       "display/resolution_notification_controller.h",
119       "system/tray/media_security/media_capture_observer.h",
120       "system/tray/media_security/multi_profile_media_tray_item.cc",
121       "system/tray/media_security/multi_profile_media_tray_item.h",
122       "touch/touch_transformer_controller.cc",
123       "touch/touch_transformer_controller.h",
124       "touch/touchscreen_util.cc",
125       "touch/touchscreen_util.h",
126       "virtual_keyboard_controller.cc",
127       "virtual_keyboard_controller.h",
128     ]
129   }
131   if (!use_ozone) {
132     sources -= [
133       "host/ash_window_tree_host_ozone.cc",
134       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc",
135       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h",
136     ]
137   }
140 component("ash_with_content") {
141   sources = [
142     "content_support/ash_with_content_export.h",
143     "content_support/gpu_support_impl.cc",
144     "content_support/gpu_support_impl.h",
145     "keyboard_overlay/keyboard_overlay_delegate.cc",
146     "keyboard_overlay/keyboard_overlay_delegate.h",
147     "keyboard_overlay/keyboard_overlay_view.cc",
148     "keyboard_overlay/keyboard_overlay_view.h",
149   ]
151   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
153   public_deps = [
154     ":ash",
155   ]
156   deps = [
157     "//base",
158     "//base/third_party/dynamic_annotations",
159     "//content/public/browser",
160     "//ipc",
161     "//skia",
162     "//ui/aura",
163     "//ui/base",
164     "//ui/compositor",
165     "//ui/events",
166     "//ui/gfx",
167     "//ui/gfx/geometry",
168     "//ui/resources",
169     "//ui/strings",
170     "//ui/views",
171     "//ui/views/controls/webview",
172     "//ui/web_dialogs",
173     "//url",
174   ]
177 source_set("test_support") {
178   testonly = true
179   sources = gypi_values.ash_test_support_sources
180   configs += [ "//build/config:precompiled_headers" ]
182   public_deps = [
183     ":ash",
184   ]
185   deps = [
186     "//ash/resources",
187     "//content/test:test_support",
188     "//skia",
189     "//testing/gtest",
190     "//ui/accessibility",
191     "//ui/app_list",
192     "//ui/app_list:test_support",
193     "//ui/events:events_base",
194     "//ui/events/devices",
195     "//ui/gl",
196     "//ui/views",
197     "//ui/views:test_support",
198   ]
200   if (is_win) {
201     sources += [
202       "test/test_metro_viewer_process_host.cc",
203       "test/test_metro_viewer_process_host.h",
204     ]
205     deps += [
206       "//ipc",
207       "//ui/metro_viewer",
208       "//ui/platform_window/win",
209       "//win8:metro_viewer",
210       "//win8:test_support_win8",
211       "//win8:test_registrar",
212     ]
213   }
216 static_library("ash_shell_lib") {
217   testonly = true
218   sources = gypi_values.ash_shell_lib_sources
220   deps = [
221     ":ash",
222     ":ash_with_content",
223     ":test_support",
224     "//ash/resources",
225     "//ash/strings",
226     "//base",
227     "//base:i18n",
229     #"//chrome:packed_resources",  TODO(GYP)
230     "//content",
231     "//content/shell:content_shell_lib",
232     "//net",
233     "//skia",
234     "//third_party/icu",
235     "//ui/app_list",
236     "//ui/aura",
237     "//ui/base",
238     "//ui/base/ime",
239     "//ui/compositor",
240     "//ui/events",
241     "//ui/events:events_base",
242     "//ui/gfx",
243     "//ui/gfx/geometry",
244     "//ui/keyboard",
245     "//ui/message_center",
246     "//ui/resources",
247     "//ui/views",
248     "//ui/views:test_support",
249     "//ui/views/examples:views_examples_lib",
250     "//ui/views/examples:views_examples_with_content_lib",
251   ]
254 test("ash_unittests") {
255   sources = gypi_values.ash_unittests_sources
256   configs += [ "//build/config:precompiled_headers" ]
258   deps = [
259     ":ash",
260     ":ash_with_content",
261     ":test_support",
262     "//ash/resources",
263     "//ash/strings",
264     "//base",
265     "//base/allocator",
266     "//base/test:test_support",
267     "//components/user_manager",
268     "//content/public/browser",
269     "//content/test:test_support",
270     "//skia",
271     "//testing/gtest",
272     "//third_party/icu",
273     "//ui/accessibility",
274     "//ui/aura",
275     "//ui/aura:test_support",
276     "//ui/base",
277     "//ui/base/ime",
278     "//ui/base:test_support",
279     "//ui/compositor",
280     "//ui/compositor:test_support",
281     "//ui/events",
282     "//ui/events/devices",
283     "//ui/events:test_support",
284     "//ui/events:gesture_detection",
285     "//ui/gfx",
286     "//ui/gfx/geometry",
287     "//ui/keyboard",
288     "//ui/message_center",
289     "//ui/message_center:test_support",
290     "//ui/resources",
291     "//ui/views",
292     "//ui/views:test_support",
293     "//ui/views/controls/webview:test_support",
294     "//ui/web_dialogs:test_support",
295     "//ui/wm",
296     "//url",
297   ]
299   if (!is_chromeos) {
300     sources -= [
301       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
302       "focus_cycler_unittest.cc",
304       # All tests for multiple displays: not supported on Windows Ash.
305       "wm/drag_window_resizer_unittest.cc",
307       # Accelerometer is only available on Chrome OS.
308       "wm/maximize_mode/maximize_mode_controller_unittest.cc",
310       # Can't resize on Windows Ash. http://crbug.com/165962
311       "autoclick/autoclick_unittest.cc",
312       "magnifier/magnification_controller_unittest.cc",
313       "sticky_keys/sticky_keys_overlay_unittest.cc",
314       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
315       "virtual_keyboard_controller_unittest.cc",
316       "wm/workspace/workspace_window_resizer_unittest.cc",
317     ]
318     sources += [
319       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
320     ]
321   }
323   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
325   if (!use_x11) {
326     sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ]
327   }
328   if (is_chromeos) {
329     sources += [ "first_run/first_run_helper_unittest.cc" ]
330     deps += [
331       "//device/bluetooth",
332       "//ui/display",
333       "//ui/display:test_util",
334       "//ui/display/types",
335       "//chromeos:power_manager_proto",
336       "//chromeos:test_support_without_gmock",
337     ]
338   } else {
339     sources -= [
340       "accelerators/magnifier_key_scroller_unittest.cc",
341       "accelerators/spoken_feedback_toggler_unittest.cc",
342       "display/resolution_notification_controller_unittest.cc",
343       "touch/touchscreen_util_unittest.cc",
344     ]
345   }
347   if (!use_x11 || !is_chromeos) {
348     sources -= [ "touch/touch_transformer_controller_unittest.cc" ]
349   }
351   # TODO(GYP) is this necessary?
352   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
353   # ldflags = "-rdynamic"
355   if (!is_chromeos || use_ozone) {
356     sources -= [ "sticky_keys/sticky_keys_unittest.cc" ]  # crbug.com/354035
357   }
360 executable("ash_shell") {
361   testonly = true
362   sources = [
363     "shell/shell_main.cc",
364   ]
366   deps = [
367     ":ash_shell_lib",
368     "//components/user_manager",
369   ]
371   if (is_win) {
372     configs -= [ "//build/config/win:console" ]
373     configs += [ "//build/config/win:windowed" ]
374     deps += [ "//sandbox" ]
375   }
377   if (is_chromeos) {
378     deps += [ "//device/bluetooth" ]
379   }
382 test("ash_shell_unittests") {
383   sources = [
384     "shell/window_watcher_unittest.cc",
385     "test/ash_unittests.cc",
386   ]
388   deps = [
389     ":ash_shell_lib",
390     ":test_support",
391     "//base/test:test_support",
392     "//components/user_manager",
393     "//content/test:test_support",
394     "//skia",
395     "//testing/gtest",
396     "//ui/accessibility",
397   ]
399   if (is_chromeos) {
400     deps += [ "//ui/display" ]
401   }
403 # When adding support for isolates, please have a look at run-time dependencies
404 # in the ash_unittests_run target in ash.gyp.