Update UnusedResources lint suppressions.
[chromium-blink-merge.git] / ui / ozone / BUILD.gn
blobcdec05fe9ffd3928d1eac8b9620c1b3698eab0db
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("//ui/ozone/ozone.gni")
6 import("//testing/test.gni")
8 # The list of platforms that will be built.
9 ozone_platforms = []
11 # Extra dependencies to pull into ui/ozone for built platforms.
12 ozone_platform_deps = []
14 # Extra dependencies to pull into ozone_unittests for built platforms.
15 ozone_platform_test_deps = []
17 if (ozone_platform_egltest) {
18   ozone_platforms += [ "egltest" ]
19   ozone_platform_deps += [ "platform/egltest" ]
22 if (ozone_platform_test) {
23   ozone_platforms += [ "test" ]
24   ozone_platform_deps += [ "platform/test" ]
27 if (ozone_platform_caca) {
28   ozone_platforms += [ "caca" ]
29   ozone_platform_deps += [ "platform/caca" ]
32 if (ozone_platform_dri || ozone_platform_drm) {
33   ozone_platforms += [
34     "dri",
35     "drm",
36   ]
37   ozone_platform_deps += [ "platform/drm" ]
38   ozone_platform_test_deps += [ "platform/drm:drm_unittests" ]
41 if (ozone_platform_gbm) {
42   ozone_platforms += [ "gbm" ]
43   ozone_platform_deps += [ "platform/drm:gbm" ]
46 platform_list_cc_file = "$target_gen_dir/platform_list.cc"
47 platform_list_h_file = "$target_gen_dir/platform_list.h"
48 platform_list_txt_file = "$target_gen_dir/platform_list.txt"
49 constructor_list_cc_file = "$target_gen_dir/constructor_list.cc"
51 # GYP version: ui/ozone/ozone.gyp:ozone_base
52 component("ozone_base") {
53   sources = [
54     "public/cursor_factory_ozone.cc",
55     "public/cursor_factory_ozone.h",
56     "public/gpu_platform_support.cc",
57     "public/gpu_platform_support.h",
58     "public/gpu_platform_support_host.cc",
59     "public/gpu_platform_support_host.h",
60     "public/overlay_candidates_ozone.cc",
61     "public/overlay_candidates_ozone.h",
62     "public/overlay_manager_ozone.h",
63     "public/surface_factory_ozone.cc",
64     "public/surface_factory_ozone.h",
65     "public/surface_ozone_canvas.h",
66     "public/surface_ozone_egl.cc",
67     "public/surface_ozone_egl.h",
68     "public/system_input_injector.h",
69   ]
71   defines = [ "OZONE_BASE_IMPLEMENTATION" ]
73   deps = [
74     "//base",
75     "//skia",
76     "//ui/gfx/geometry",
77   ]
80 component("ozone") {
81   sources = [
82     "common/display_mode_proxy.cc",
83     "common/display_mode_proxy.h",
84     "common/display_snapshot_proxy.cc",
85     "common/display_snapshot_proxy.h",
86     "common/display_util.cc",
87     "common/display_util.h",
88     "common/egl_util.cc",
89     "common/egl_util.h",
90     "common/gpu/ozone_gpu_message_generator.cc",
91     "common/gpu/ozone_gpu_message_generator.h",
92     "common/gpu/ozone_gpu_message_params.cc",
93     "common/gpu/ozone_gpu_message_params.h",
94     "common/gpu/ozone_gpu_messages.h",
95     "common/native_display_delegate_ozone.cc",
96     "common/native_display_delegate_ozone.h",
97     "common/stub_overlay_manager.cc",
98     "common/stub_overlay_manager.h",
99     "platform_selection.cc",
100     "platform_selection.h",
101     "public/input_controller.cc",
102     "public/input_controller.h",
103     "public/ozone_gpu_test_helper.cc",
104     "public/ozone_gpu_test_helper.h",
105     "public/ozone_platform.cc",
106     "public/ozone_platform.h",
107     "public/ozone_switches.cc",
108     "public/ozone_switches.h",
109     constructor_list_cc_file,
110     platform_list_cc_file,
111     platform_list_h_file,
112   ]
114   defines = [ "OZONE_IMPLEMENTATION" ]
116   deps =
117       [
118         ":generate_constructor_list",
119         ":generate_ozone_platform_list",
120         ":ozone_base",
121         "//base",
122         "//ipc",
123         "//skia",
124         "//ui/display/types",
125         "//ui/display/util",
126         "//ui/events",
127         "//ui/events/ozone:events_ozone",
128         "//ui/gfx",
129         "//ui/gfx/geometry",
130         "//ui/gfx/ipc",
132         # TODO(GYP) the GYP version has a way to add additional dependencies via
133         # build flags.
134       ] + ozone_platform_deps
137 # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list
138 action("generate_ozone_platform_list") {
139   script = "generate_ozone_platform_list.py"
140   outputs = [
141     platform_list_cc_file,
142     platform_list_h_file,
143     platform_list_txt_file,
144   ]
146   args =
147       [
148         "--output_cc=" + rebase_path(platform_list_cc_file, root_build_dir),
149         "--output_h=" + rebase_path(platform_list_h_file, root_build_dir),
150         "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir),
151         "--default=$ozone_platform",
152       ] + ozone_platforms
155 # GYP version: ui/ozone/ozone.gyp:generate_constructor_list
156 action("generate_constructor_list") {
157   script = "generate_constructor_list.py"
159   inputs = [
160     platform_list_txt_file,
161   ]
162   outputs = [
163     constructor_list_cc_file,
164   ]
166   args = [
167     "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
168     "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
169     "--namespace=ui",
170     "--typename=OzonePlatform",
171     "--include=\"ui/ozone/public/ozone_platform.h\"",
172   ]
174   deps = [
175     ":generate_ozone_platform_list",
176   ]
179 test("ozone_unittests") {
180   sources = [
181     "run_all_unittests.cc",
182   ]
184   deps = [
185            "//base/test:test_support",
186            "//testing/gtest",
187            "//ui/gfx/geometry",
188          ] + ozone_platform_test_deps