Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / events / events.gyp
blob128f08c9b1408d4efa8bbbab9083347296993a4b
1 # Copyright 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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       # GN version: //ui/events:dom_keycode_converter
12       'target_name': 'dom_keycode_converter',
13       'type': 'static_library',
14       'dependencies': [
15         '<(DEPTH)/base/base.gyp:base',
16       ],
17       'sources': [
18         # Note: sources list duplicated in GN build.
19         'keycodes/dom/dom_code.h',
20         'keycodes/dom/dom_key.h',
21         'keycodes/dom/dom_key_data.inc',
22         'keycodes/dom/keycode_converter.cc',
23         'keycodes/dom/keycode_converter.h',
24         'keycodes/dom/keycode_converter_data.inc',
25       ],
26     },
27     {
28       # GN version: //ui/events:events_base
29       'target_name': 'events_base',
30       'type': '<(component)',
31       'dependencies': [
32         '<(DEPTH)/base/base.gyp:base',
33         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
34         '<(DEPTH)/skia/skia.gyp:skia',
35         '../gfx/gfx.gyp:gfx',
36         '../gfx/gfx.gyp:gfx_geometry',
37         'dom_keycode_converter',
38       ],
39       'defines': [
40         'EVENTS_BASE_IMPLEMENTATION',
41       ],
42       'sources': [
43         # Note: sources list duplicated in GN build.
44         'android/scroller.cc',
45         'android/scroller.h',
46         'base_event_utils.cc',
47         'base_event_utils.h',
48         'event_constants.h',
49         'event_switches.cc',
50         'event_switches.h',
51         'events_base_export.h',
52         'gesture_curve.h',
53         'gesture_event_details.cc',
54         'gesture_event_details.h',
55         'gestures/fling_curve.cc',
56         'gestures/fling_curve.h',
57         'keycodes/dom_us_layout_data.h',
58         'keycodes/keyboard_code_conversion.cc',
59         'keycodes/keyboard_code_conversion.h',
60         'keycodes/keyboard_code_conversion_android.cc',
61         'keycodes/keyboard_code_conversion_android.h',
62         'keycodes/keyboard_code_conversion_mac.h',
63         'keycodes/keyboard_code_conversion_mac.mm',
64         'keycodes/keyboard_code_conversion_win.cc',
65         'keycodes/keyboard_code_conversion_win.h',
66         'keycodes/keyboard_code_conversion_x.cc',
67         'keycodes/keyboard_code_conversion_x.h',
68         'keycodes/keyboard_codes.h',
69         'latency_info.cc',
70         'latency_info.h',
71         'x/keysym_to_unicode.cc',
72         'x/keysym_to_unicode.h',
73       ],
74       'export_dependent_settings': [
75         '../../ui/gfx/gfx.gyp:gfx',
76       ],
77       'conditions': [
78         ['use_x11==1', {
79           'dependencies': [
80             '../../build/linux/system.gyp:x11',
81             '../gfx/x/gfx_x11.gyp:gfx_x11',
82           ],
83         }],
84         ['use_x11==1 or use_xkbcommon==1', {
85           'sources': [
86             'keycodes/keyboard_code_conversion_xkb.cc',
87             'keycodes/keyboard_code_conversion_xkb.h',
88             'keycodes/xkb_keysym.h',
89           ],
90         }],
91       ],
92     },
93     {
94       # GN version: //ui/events
95       'target_name': 'events',
96       'type': '<(component)',
97       'dependencies': [
98         '<(DEPTH)/base/base.gyp:base',
99         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
100         '<(DEPTH)/skia/skia.gyp:skia',
101         '../gfx/gfx.gyp:gfx',
102         '../gfx/gfx.gyp:gfx_geometry',
103         'dom_keycode_converter',
104         'events_base',
105         'gesture_detection',
106       ],
107       'defines': [
108         'EVENTS_IMPLEMENTATION',
109       ],
110       'sources': [
111         # Note: sources list duplicated in GN build.
112         'cocoa/cocoa_event_utils.h',
113         'cocoa/cocoa_event_utils.mm',
114         'cocoa/events_mac.mm',
115         'event.cc',
116         'event.h',
117         'event_dispatcher.cc',
118         'event_dispatcher.h',
119         'event_handler.cc',
120         'event_handler.h',
121         'event_processor.cc',
122         'event_processor.h',
123         'event_rewriter.h',
124         'event_source.cc',
125         'event_source.h',
126         'event_target.cc',
127         'event_target.h',
128         'event_target_iterator.h',
129         'event_targeter.h',
130         'event_utils.cc',
131         'event_utils.h',
132         'events_export.h',
133         'events_stub.cc',
134         'gestures/gesture_provider_aura.cc',
135         'gestures/gesture_provider_aura.h',
136         'gestures/gesture_recognizer.h',
137         'gestures/gesture_recognizer_impl.cc',
138         'gestures/gesture_recognizer_impl.h',
139         'gestures/gesture_recognizer_impl_mac.cc',
140         'gestures/gesture_types.h',
141         'gestures/motion_event_aura.cc',
142         'gestures/motion_event_aura.h',
143         'linux/text_edit_command_auralinux.cc',
144         'linux/text_edit_command_auralinux.h',
145         'linux/text_edit_key_bindings_delegate_auralinux.cc',
146         'linux/text_edit_key_bindings_delegate_auralinux.h',
147         'null_event_targeter.cc',
148         'null_event_targeter.h',
149         'ozone/events_ozone.cc',
150         'win/events_win.cc',
151         'x/events_x.cc',
152       ],
153       'conditions': [
154         ['use_x11==1', {
155           'dependencies': [
156             'devices/events_devices.gyp:events_devices',
157             '../gfx/x/gfx_x11.gyp:gfx_x11',
158             '../../build/linux/system.gyp:x11',
159           ],
160         }],
161         ['use_aura==0', {
162           'sources!': [
163             'gestures/gesture_provider_aura.cc',
164             'gestures/gesture_provider_aura.h',
165             'gestures/gesture_recognizer.h',
166             'gestures/gesture_recognizer_impl.cc',
167             'gestures/gesture_recognizer_impl.h',
168             'gestures/gesture_types.h',
169             'gestures/motion_event_aura.cc',
170             'gestures/motion_event_aura.h',
171           ],
172         }],
173         # We explicitly enumerate the platforms we _do_ provide native cracking
174         # for here.
175         ['OS=="win" or OS=="mac" or use_x11==1 or use_ozone==1', {
176           'sources!': [
177             'events_stub.cc',
178           ],
179         }],
180         ['chromeos==1', {
181           'sources!': [
182             'linux/text_edit_command_auralinux.cc',
183             'linux/text_edit_command_auralinux.h',
184             'linux/text_edit_key_bindings_delegate_auralinux.cc',
185             'linux/text_edit_key_bindings_delegate_auralinux.h',
186           ],
187         }],
188         ['use_ozone==1', {
189           'dependencies': [
190             'ozone/events_ozone.gyp:events_ozone_layout',
191           ],
192         }],
193       ],
194     },
195     {
196       # GN version: //ui/events/blink
197       'target_name': 'blink',
198       'type': 'static_library',
199       'dependencies': [
200         '../../third_party/WebKit/public/blink_headers.gyp:blink_headers',
201         '../gfx/gfx.gyp:gfx_geometry',
202         'events',
203         'gesture_detection',
204       ],
205       'sources': [
206         # Note: sources list duplicated in GN build.
207         'blink/blink_event_util.cc',
208         'blink/blink_event_util.h',
209       ],
210     },
211     {
212       # GN version: //ui/events/gestures/blink
213       'target_name': 'gestures_blink',
214       'type': 'static_library',
215       'dependencies': [
216         '../../base/base.gyp:base',
217         '../../third_party/WebKit/public/blink_headers.gyp:blink_headers',
218         '../gfx/gfx.gyp:gfx_geometry',
219         'events',
220         'gesture_detection',
221       ],
222       'sources': [
223         # Note: sources list duplicated in GN build.
224         'gestures/blink/web_gesture_curve_impl.cc',
225         'gestures/blink/web_gesture_curve_impl.h',
226       ],
227     },
228     {
229       # GN version: //ui/events:gesture_detection
230       'target_name': 'gesture_detection',
231       'type': '<(component)',
232       'dependencies': [
233         '<(DEPTH)/base/base.gyp:base',
234         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
235         '../gfx/gfx.gyp:gfx',
236         '../gfx/gfx.gyp:gfx_geometry',
237         'events_base',
238       ],
239       'defines': [
240         'GESTURE_DETECTION_IMPLEMENTATION',
241       ],
242       'sources': [
243         # Note: sources list duplicated in GN build.
244         'gesture_detection/bitset_32.h',
245         'gesture_detection/filtered_gesture_provider.cc',
246         'gesture_detection/filtered_gesture_provider.h',
247         'gesture_detection/gesture_configuration.cc',
248         'gesture_detection/gesture_configuration.h',
249         'gesture_detection/gesture_configuration_android.cc',
250         'gesture_detection/gesture_configuration_aura.cc',
251         'gesture_detection/gesture_detection_export.h',
252         'gesture_detection/gesture_detector.cc',
253         'gesture_detection/gesture_detector.h',
254         'gesture_detection/gesture_event_data.cc',
255         'gesture_detection/gesture_event_data.h',
256         'gesture_detection/gesture_event_data_packet.cc',
257         'gesture_detection/gesture_event_data_packet.h',
258         'gesture_detection/gesture_listeners.cc',
259         'gesture_detection/gesture_listeners.h',
260         'gesture_detection/gesture_provider.cc',
261         'gesture_detection/gesture_provider.h',
262         'gesture_detection/gesture_provider_config_helper.cc',
263         'gesture_detection/gesture_provider_config_helper.h',
264         'gesture_detection/gesture_touch_uma_histogram.cc',
265         'gesture_detection/gesture_touch_uma_histogram.h',
266         'gesture_detection/motion_event.cc',
267         'gesture_detection/motion_event.h',
268         'gesture_detection/motion_event_buffer.cc',
269         'gesture_detection/motion_event_buffer.h',
270         'gesture_detection/motion_event_generic.cc',
271         'gesture_detection/motion_event_generic.h',
272         'gesture_detection/scale_gesture_detector.cc',
273         'gesture_detection/scale_gesture_detector.h',
274         'gesture_detection/scale_gesture_listeners.cc',
275         'gesture_detection/scale_gesture_listeners.h',
276         'gesture_detection/snap_scroll_controller.cc',
277         'gesture_detection/snap_scroll_controller.h',
278         'gesture_detection/touch_disposition_gesture_filter.cc',
279         'gesture_detection/touch_disposition_gesture_filter.h',
280         'gesture_detection/velocity_tracker.cc',
281         'gesture_detection/velocity_tracker.h',
282         'gesture_detection/velocity_tracker_state.cc',
283         'gesture_detection/velocity_tracker_state.h',
284       ],
285       'conditions': [
286         ['use_aura!=1 and OS!="android"', {
287           'sources': [
288             'gesture_detection/gesture_configuration_default.cc',
289           ],
290         }],
291       ],
292     },
293     {
294       # GN version: //ui/events/ipc:events_ipc
295       'target_name': 'events_ipc',
296       'type': '<(component)',
297       'dependencies': [
298         '<(DEPTH)/base/base.gyp:base',
299         '<(DEPTH)/ipc/ipc.gyp:ipc',
300         'events_base',
301       ],
302       'defines': [
303         'EVENTS_IPC_IMPLEMENTATION',
304       ],
305       'sources': [
306         'ipc/latency_info_param_traits.cc',
307         'ipc/latency_info_param_traits.h',
308       ],
309     },
310     {
311       # GN version: //ui/events:test_support
312       'target_name': 'events_test_support',
313       'type': 'static_library',
314       'dependencies': [
315         '<(DEPTH)/base/base.gyp:base',
316         '<(DEPTH)/skia/skia.gyp:skia',
317         '../gfx/gfx.gyp:gfx_geometry',
318         'events',
319         'events_base',
320         'gesture_detection',
321         'platform/events_platform.gyp:events_platform',
322       ],
323       'sources': [
324         # Note: sources list duplicated in GN build.
325         'test/cocoa_test_event_utils.h',
326         'test/cocoa_test_event_utils.mm',
327         'test/device_data_manager_test_api.h',
328         'test/event_generator.cc',
329         'test/event_generator.h',
330         'test/events_test_utils.cc',
331         'test/events_test_utils.h',
332         'test/events_test_utils_x11.cc',
333         'test/events_test_utils_x11.h',
334         'test/motion_event_test_utils.cc',
335         'test/motion_event_test_utils.h',
336         'test/platform_event_source_test_api.cc',
337         'test/platform_event_source_test_api.h',
338         'test/platform_event_waiter.cc',
339         'test/platform_event_waiter.h',
340         'test/test_event_handler.cc',
341         'test/test_event_handler.h',
342         'test/test_event_processor.cc',
343         'test/test_event_processor.h',
344         'test/test_event_target.cc',
345         'test/test_event_target.h',
346         'test/test_event_targeter.cc',
347         'test/test_event_targeter.h',
348       ],
349       'conditions': [
350         ['OS=="ios"', {
351           # The cocoa files don't apply to iOS.
352           'sources/': [['exclude', 'cocoa']],
353         }],
354         ['use_x11==1 or use_ozone==1', {
355           'sources' : [
356               'test/device_data_manager_test_api_impl.cc',
357             ],
358           'dependencies': [
359             'devices/events_devices.gyp:events_devices',
360             ],
361         }, { # else use_x11=1 or use_ozone=1
362           'sources' : [
363               'test/device_data_manager_test_api_stub.cc',
364             ]
365         }],
366       ],
367     },
368     {
369       # GN version: //ui/events:events_unittests
370       'target_name': 'events_unittests',
371       'type': '<(gtest_target_type)',
372       'dependencies': [
373         '<(DEPTH)/base/base.gyp:base',
374         '<(DEPTH)/base/base.gyp:run_all_unittests',
375         '<(DEPTH)/base/base.gyp:test_support_base',
376         '<(DEPTH)/ipc/ipc.gyp:test_support_ipc',
377         '<(DEPTH)/skia/skia.gyp:skia',
378         '<(DEPTH)/testing/gtest.gyp:gtest',
379         '<(DEPTH)/third_party/mesa/mesa.gyp:osmesa',
380         '../gfx/gfx.gyp:gfx',
381         '../gfx/gfx.gyp:gfx_geometry',
382         '../gfx/gfx.gyp:gfx_test_support',
383         'devices/events_devices.gyp:events_devices',
384         'dom_keycode_converter',
385         'events',
386         'events_base',
387         'events_ipc',
388         'events_test_support',
389         'gesture_detection',
390         'gestures_blink',
391         'platform/events_platform.gyp:events_platform',
392       ],
393       'sources': [
394         # Note: sources list duplicated in GN build.
395         'android/scroller_unittest.cc',
396         'cocoa/events_mac_unittest.mm',
397         'devices/x11/device_data_manager_x11_unittest.cc',
398         'event_dispatcher_unittest.cc',
399         'event_processor_unittest.cc',
400         'event_rewriter_unittest.cc',
401         'event_unittest.cc',
402         'gesture_detection/bitset_32_unittest.cc',
403         'gesture_detection/filtered_gesture_provider_unittest.cc',
404         'gesture_detection/gesture_event_data_packet_unittest.cc',
405         'gesture_detection/gesture_provider_unittest.cc',
406         'gesture_detection/motion_event_buffer_unittest.cc',
407         'gesture_detection/motion_event_generic_unittest.cc',
408         'gesture_detection/snap_scroll_controller_unittest.cc',
409         'gesture_detection/touch_disposition_gesture_filter_unittest.cc',
410         'gesture_detection/velocity_tracker_unittest.cc',
411         'gestures/blink/web_gesture_curve_impl_unittest.cc',
412         'gestures/fling_curve_unittest.cc',
413         'gestures/gesture_provider_aura_unittest.cc',
414         'gestures/motion_event_aura_unittest.cc',
415         'ipc/latency_info_param_traits_unittest.cc',
416         'keycodes/dom/keycode_converter_unittest.cc',
417         'keycodes/keyboard_code_conversion_unittest.cc',
418         'latency_info_unittest.cc',
419         'platform/platform_event_source_unittest.cc',
420         'x/events_x_unittest.cc',
421       ],
422       'include_dirs': [
423         '../../testing/gmock/include',
424       ],
425       'conditions': [
426         ['use_x11==1', {
427           'dependencies': [
428             '../../build/linux/system.gyp:x11',
429             '../gfx/x/gfx_x11.gyp:gfx_x11',
430           ],
431         }],
432         ['use_ozone==1', {
433           'sources': [
434             'ozone/chromeos/cursor_controller_unittest.cc',
435             'ozone/evdev/event_converter_evdev_impl_unittest.cc',
436             'ozone/evdev/event_converter_test_util.cc',
437             'ozone/evdev/event_device_info_unittest.cc',
438             'ozone/evdev/event_device_test_util.cc',
439             'ozone/evdev/input_injector_evdev_unittest.cc',
440             'ozone/evdev/tablet_event_converter_evdev_unittest.cc',
441             'ozone/evdev/touch_event_converter_evdev_unittest.cc',
442             'ozone/evdev/touch_noise/touch_noise_finder_unittest.cc',
443           ],
444           'dependencies': [
445             'ozone/events_ozone.gyp:events_ozone',
446             'ozone/events_ozone.gyp:events_ozone_evdev',
447             'ozone/events_ozone.gyp:events_ozone_layout',
448           ]
449         }],
450         ['use_xkbcommon==1', {
451           'sources': [
452             'ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc',
453           ]
454         }],
455         ['use_aura==0', {
456           'sources!': [
457             'gestures/gesture_provider_aura_unittest.cc',
458             'gestures/motion_event_aura_unittest.cc',
459           ],
460         }],
461         ['OS=="linux" and use_allocator!="none"', {
462           'dependencies': [
463             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
464           ],
465         }],
466         # Exclude tests that rely on event_utils.h for platforms that do not
467         # provide native cracking, i.e., platforms that use events_stub.cc.
468         ['OS!="win" and use_x11!=1 and use_ozone!=1', {
469           'sources!': [
470             'event_unittest.cc',
471           ],
472         }],
473         ['OS == "android"', {
474           'dependencies': [
475             '../../testing/android/native_test.gyp:native_test_native_code',
476           ],
477         }],
478       ],
479     },
480   ],
481   'conditions': [
482     ['OS == "android"', {
483       'targets': [
484         {
485           'target_name': 'events_unittests_apk',
486           'type': 'none',
487           'dependencies': [
488             'events_unittests',
489           ],
490           'variables': {
491             'test_suite_name': 'events_unittests',
492           },
493           'includes': [ '../../build/apk_test.gypi' ],
494         },
495       ],
496     }],
497     ['test_isolation_mode != "noop"', {
498       'targets': [
499         {
500           'target_name': 'events_unittests_run',
501           'type': 'none',
502           'dependencies': [
503             'events_unittests',
504           ],
505           'includes': [
506             '../../build/isolate.gypi',
507           ],
508           'sources': [
509             'events_unittests.isolate',
510           ],
511           'conditions': [
512             ['use_x11 == 1', {
513               'dependencies': [
514                 '../../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
515               ],
516             }],
517           ],
518         },
519       ],
520     }],
521   ],