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