Linux Aura accessibility is enabled only on GNOME desktops
[chromium-blink-merge.git] / ui / accessibility / accessibility.gyp
blobaef0f10dfc15ef81d80c26fc79ada2c2416c3fd1
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   },
10   'targets': [
11     {
12       'target_name': 'accessibility',
13       'type': '<(component)',
14       'export_dependent_settings': [
15         'ax_gen',
16       ],
17       'hard_dependency': 1,
18       'dependencies': [
19         '../../base/base.gyp:base',
20         '../gfx/gfx.gyp:gfx',
21         '../gfx/gfx.gyp:gfx_geometry',
22         'ax_gen',
23       ],
24       'defines': [
25         'ACCESSIBILITY_IMPLEMENTATION',
26       ],
27       'sources': [
28         # All .cc, .h under accessibility, except unittests
29         'ax_node.cc',
30         'ax_node.h',
31         'ax_node_data.cc',
32         'ax_node_data.h',
33         'ax_serializable_tree.cc',
34         'ax_serializable_tree.h',
35         'ax_text_utils.cc',
36         'ax_text_utils.h',
37         'ax_tree.cc',
38         'ax_tree.h',
39         'ax_tree_serializer.cc',
40         'ax_tree_serializer.h',
41         'ax_tree_source.h',
42         'ax_tree_update.cc',
43         'ax_tree_update.h',
44         'ax_view_state.cc',
45         'ax_view_state.h',
46         'platform/atk_util_auralinux.cc',
47         'platform/atk_util_auralinux.h',
48         'platform/ax_platform_node.cc',
49         'platform/ax_platform_node.h',
50         'platform/ax_platform_node_auralinux.cc',
51         'platform/ax_platform_node_auralinux.h',
52         'platform/ax_platform_node_base.cc',
53         'platform/ax_platform_node_base.h',
54         'platform/ax_platform_node_delegate.h',
55         'platform/ax_platform_node_mac.h',
56         'platform/ax_platform_node_mac.mm',
57         'platform/ax_platform_node_win.h',
58         'platform/ax_platform_node_win.cc',
59       ],
60       'conditions': [
61         ['OS=="win"', {
62           'dependencies': [
63             '../../third_party/iaccessible2/iaccessible2.gyp:iaccessible2'
64           ],
65         }],
66         ['OS=="linux" and chromeos==0 and use_gconf==1',{
67           'dependencies': [
68             '../../build/linux/system.gyp:gconf',
69           ],
70         }],
71         ['OS=="linux" and chromeos==0 and use_dbus==1', {
72           'dependencies': [
73             '../../build/linux/system.gyp:dbus',
74             '../../dbus/dbus.gyp:dbus',
75           ],
76         }],
77         ['OS=="linux" and chromeos==0 and use_x11==1', {
78           'dependencies': [
79             '../../build/linux/system.gyp:atk',
80             '../../build/linux/system.gyp:glib',
81           ],
82           'variables': {
83             'clang_warning_flags': [
84               # glib uses the pre-c++11 typedef-as-static_assert hack.
85               '-Wno-unused-local-typedefs',
86             ],
87           },
88         }],
89         ['OS!="linux" or chromeos==1 or use_x11==0', {
90           'sources!': [
91             'platform/ax_platform_node_auralinux.cc',
92             'platform/ax_platform_node_auralinux.h',
93             'platform/atk_util_auralinux.cc',
94             'platform/atk_util_auralinux.h',
95           ],
96         }],
97       ],
98     },
99     {
100       'target_name': 'accessibility_test_support',
101       'type': 'static_library',
102       'dependencies': [
103         '../../base/base.gyp:base',
104         'accessibility'
105       ],
106       'sources': [
107         'platform/test_ax_node_wrapper.cc',
108         'platform/test_ax_node_wrapper.h',
109         'tree_generator.cc',
110         'tree_generator.h',
111       ]
112     },
113     {
114       'target_name': 'accessibility_unittests',
115       'type': 'executable',
116       'dependencies': [
117         '../../base/base.gyp:base',
118         '../../base/base.gyp:run_all_unittests',
119         '../../testing/gtest.gyp:gtest',
120         '../gfx/gfx.gyp:gfx',
121         '../gfx/gfx.gyp:gfx_geometry',
122         'accessibility',
123         'accessibility_test_support',
124         'ax_gen',
125       ],
126       'sources': [
127         'ax_generated_tree_unittest.cc',
128         'ax_text_utils_unittest.cc',
129         'ax_tree_serializer_unittest.cc',
130         'ax_tree_unittest.cc',
131         'platform/ax_platform_node_win_unittest.cc'
132       ],
133       'conditions': [
134         ['OS=="win"', {
135           'dependencies': [
136             '../../third_party/iaccessible2/iaccessible2.gyp:iaccessible2'
137           ],
138         }],
139       ],
140     },
141     {
142       'target_name': 'ax_gen',
143       'type': 'static_library',
144       # This target exports a hard dependency because dependent targets may
145       # include ax_enums.h, a generated header.
146       'hard_dependency': 1,
147       'dependencies': [
148         '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations'
149         ],
150       'sources': [
151         '<@(schema_files)',
152       ],
153       'msvs_disabled_warnings': [ 4267 ],
154       'includes': [
155         '../../build/json_schema_compile.gypi',
156       ],
157       'variables': {
158         'chromium_code': 1,
159         'schema_files': [
160           'ax_enums.idl',
161         ],
162         'non_compiled_schema_files': [],
163         'cc_dir': 'ui/accessibility',
164         # TODO(dtseng): Change this once all files under ui/accessibility
165         # namespaced under ui::ax.
166         'root_namespace': 'ui',
167       },
168     },
169   ],
170   'conditions': [
171     ['test_isolation_mode != "noop"', {
172       'targets': [
173         {
174           'target_name': 'accessibility_unittests_run',
175           'type': 'none',
176           'dependencies': [
177             'accessibility_unittests',
178           ],
179           'includes': [
180             '../../build/isolate.gypi',
181           ],
182           'sources': [
183             'accessibility_unittests.isolate',
184           ],
185           'conditions': [
186             ['use_x11 == 1', {
187               'dependencies': [
188                 '../../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
189               ],
190             }],
191           ],
192         },
193       ],
194     }],
195   ],