Fix content verifier problem with content scripts (reland)
[chromium-blink-merge.git] / ui / accessibility / BUILD.gn
blob3a195f331678e6ca97fb0d78a9844d970d34c48e
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/linux/pkg_config.gni")
6 import("//build/config/ui.gni")
7 import("//build/json_schema_api.gni")
8 import("//testing/test.gni")
9 if (is_android) {
10   import("//build/config/android/rules.gni")
13 if (use_x11) {
14   pkg_config("atk") {
15     packages = [ "atk" ]
16     atk_lib_dir = exec_script(pkg_config_script,
17                               [
18                                 "--libdir",
19                                 "atk",
20                               ],
21                               "string")
22     defines = [ "ATK_LIB_DIR=\"$atk_lib_dir\"" ]
23   }
25   # gn orders flags on a target before flags from configs. The default config
26   # adds -Wall, and these flags have to be after -Wall -- so they need to come
27   # from a config and can't be on the target directly.
28   config("atk_warnings") {
29     cflags = [
30       # glib uses the pre-c++11 typedef-as-static_assert hack.
31       "-Wno-unused-local-typedef",
33       # G_DEFINE_TYPE automatically generates a *get_instance_private
34       # inline function after glib 2.37. That's unused. Prevent to
35       # complain about it.
36       "-Wno-unused-function",
37     ]
38   }
41 component("accessibility") {
42   sources = [
43     "ax_node.cc",
44     "ax_node.h",
45     "ax_node_data.cc",
46     "ax_node_data.h",
47     "ax_serializable_tree.cc",
48     "ax_serializable_tree.h",
49     "ax_text_utils.cc",
50     "ax_text_utils.h",
51     "ax_tree.cc",
52     "ax_tree.h",
53     "ax_tree_serializer.cc",
54     "ax_tree_serializer.h",
55     "ax_tree_source.h",
56     "ax_tree_update.cc",
57     "ax_tree_update.h",
58     "ax_view_state.cc",
59     "ax_view_state.h",
60     "platform/ax_platform_node.cc",
61     "platform/ax_platform_node.h",
62     "platform/ax_platform_node_base.cc",
63     "platform/ax_platform_node_base.h",
64     "platform/ax_platform_node_delegate.h",
65     "platform/ax_platform_node_mac.h",
66     "platform/ax_platform_node_mac.mm",
67     "platform/ax_platform_node_win.cc",
68     "platform/ax_platform_node_win.h",
69   ]
71   defines = [ "ACCESSIBILITY_IMPLEMENTATION" ]
73   public_deps = [
74     ":ax_gen",
75     "//base",
76     "//ui/gfx",
77     "//ui/gfx/geometry",
78   ]
80   if (is_win) {
81     public_deps += [ "//third_party/iaccessible2" ]
82   }
84   if (use_atk) {
85     sources += [
86       "platform/atk_util_auralinux.cc",
87       "platform/atk_util_auralinux.h",
88       "platform/ax_platform_node_auralinux.cc",
89       "platform/ax_platform_node_auralinux.h",
90     ]
92     configs += [
93       ":atk",
94       ":atk_warnings",
95       "//build/config/linux:gconf",
96       "//build/config/linux:glib",
97     ]
98   }
101 if (is_android) {
102   android_library("ui_accessibility_java") {
103     deps = []
104     srcjar_deps = [ ":ax_enumerations_srcjar" ]
105   }
107   java_cpp_enum("ax_enumerations_srcjar") {
108     sources = [
109       "ax_enums.idl",
110     ]
111     outputs = [
112       "org/chromium/ui/accessibility/AXTextStyle.java",
113     ]
114   }
117 source_set("test_support") {
118   sources = [
119     "platform/test_ax_node_wrapper.cc",
120     "platform/test_ax_node_wrapper.h",
121     "tree_generator.cc",
122     "tree_generator.h",
123   ]
125   deps = [
126     ":accessibility",
127   ]
130 # TODO(GYP): Delete this after we've converted everything to GN.
131 # The _run targets exist only for compatibility w/ GYP.
132 group("accessibility_unittests_run") {
133   testonly = true
134   deps = [
135     ":accessibility_unittests",
136   ]
139 test("accessibility_unittests") {
140   sources = [
141     "ax_generated_tree_unittest.cc",
142     "ax_text_utils_unittest.cc",
143     "ax_tree_serializer_unittest.cc",
144     "ax_tree_unittest.cc",
145     "platform/ax_platform_node_win_unittest.cc",
146   ]
148   deps = [
149     ":accessibility",
150     ":test_support",
151     "//base",
152     "//base/test:run_all_unittests",
153     "//testing/gtest",
154     "//ui/gfx",
155     "//ui/gfx/geometry",
156   ]
158   if (is_win) {
159     deps += [ "//third_party/iaccessible2" ]
160   }
163 json_schema_api("ax_gen") {
164   sources = [
165     "ax_enums.idl",
166   ]
167   deps = [
168     "//base/third_party/dynamic_annotations",
169   ]
170   root_namespace = "ui"
171   schemas = true