Revert "[Hotword] Implement IsHotwordHardwareAvailable() using device types."
[chromium-blink-merge.git] / ui / ozone / BUILD.gn
blob40d45cf7328748c75358fb39f5265a520eb3cb96
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")
7 # The list of platforms that will be built.
8 ozone_platforms = []
10 # Extra dependencies to pull into ui/ozone for built platforms.
11 ozone_platform_deps = []
13 # Extra dependencies to pull into ozone_unittests for built platforms.
14 ozone_platform_test_deps = []
16 if (ozone_platform_egltest) {
17   ozone_platforms += [ "egltest" ]
18   ozone_platform_deps += [ "platform/egltest" ]
21 if (ozone_platform_test) {
22   ozone_platforms += [ "test" ]
23   ozone_platform_deps += [ "platform/test" ]
26 if (ozone_platform_caca) {
27   ozone_platforms += [ "caca" ]
28   ozone_platform_deps += [ "platform/caca" ]
31 if (ozone_platform_dri) {
32   ozone_platforms += [ "dri" ]
33   ozone_platform_deps += [ "platform/dri" ]
34   ozone_platform_test_deps += [ "platform/dri:dri_unittests" ]
37 if (ozone_platform_gbm) {
38   ozone_platforms += [ "gbm" ]
39   ozone_platform_deps += [ "platform/dri:gbm" ]
42 platform_list_cc_file = "$target_gen_dir/platform_list.cc"
43 platform_list_h_file = "$target_gen_dir/platform_list.h"
44 platform_list_txt_file = "$target_gen_dir/platform_list.txt"
45 constructor_list_cc_file = "$target_gen_dir/constructor_list.cc"
47 # GYP version: ui/ozone/ozone.gyp:ozone_base
48 component("ozone_base") {
49   sources = [
50     "public/cursor_factory_ozone.cc",
51     "public/cursor_factory_ozone.h",
52     "public/gpu_platform_support.cc",
53     "public/gpu_platform_support.h",
54     "public/gpu_platform_support_host.cc",
55     "public/gpu_platform_support_host.h",
56     "public/overlay_candidates_ozone.cc",
57     "public/overlay_candidates_ozone.h",
58     "public/surface_factory_ozone.cc",
59     "public/surface_factory_ozone.h",
60     "public/surface_ozone_canvas.h",
61     "public/surface_ozone_egl.h",
62     "public/system_input_injector.h",
63   ]
65   defines = [ "OZONE_BASE_IMPLEMENTATION" ]
67   deps = [
68     "//base",
69     "//skia",
70     "//ui/gfx/geometry",
71   ]
74 component("ozone") {
75   sources = [
76     platform_list_cc_file,
77     platform_list_h_file,
78     constructor_list_cc_file,
79     "common/display_mode_proxy.cc",
80     "common/display_mode_proxy.h",
81     "common/display_snapshot_proxy.cc",
82     "common/display_snapshot_proxy.h",
83     "common/display_util.cc",
84     "common/display_util.h",
85     "common/egl_util.cc",
86     "common/egl_util.h",
87     "common/gpu/ozone_gpu_message_generator.cc",
88     "common/gpu/ozone_gpu_message_generator.h",
89     "common/gpu/ozone_gpu_message_params.cc",
90     "common/gpu/ozone_gpu_message_params.h",
91     "common/gpu/ozone_gpu_messages.h",
92     "common/native_display_delegate_ozone.cc",
93     "common/native_display_delegate_ozone.h",
94     "public/input_controller.cc",
95     "public/input_controller.h",
96     "public/ozone_platform.cc",
97     "public/ozone_platform.h",
98     "public/ozone_switches.cc",
99     "public/ozone_switches.h",
100     "public/ui_thread_gpu.cc",
101     "public/ui_thread_gpu.h",
102     "platform_selection.cc",
103     "platform_selection.h",
104   ]
106   defines = [ "OZONE_IMPLEMENTATION" ]
108   deps =
109       [
110         ":generate_constructor_list",
111         ":generate_ozone_platform_list",
112         ":ozone_base",
113         "//base",
114         "//ipc",
115         "//skia",
116         "//ui/display/types",
117         "//ui/display/util",
118         "//ui/events",
119         "//ui/events/ozone:events_ozone",
120         "//ui/gfx",
121         "//ui/gfx/geometry",
122         "//ui/gfx/ipc",
124         # TODO(GYP) the GYP version has a way to add additional dependencies via
125         # build flags.
126       ] + ozone_platform_deps
129 # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list
130 action("generate_ozone_platform_list") {
131   script = "generate_ozone_platform_list.py"
132   outputs = [
133     platform_list_cc_file,
134     platform_list_h_file,
135     platform_list_txt_file,
136   ]
138   args =
139       [
140         "--output_cc=" + rebase_path(platform_list_cc_file, root_build_dir),
141         "--output_h=" + rebase_path(platform_list_h_file, root_build_dir),
142         "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir),
143         "--default=$ozone_platform",
144       ] + ozone_platforms
147 # GYP version: ui/ozone/ozone.gyp:generate_constructor_list
148 action("generate_constructor_list") {
149   script = "generate_constructor_list.py"
151   inputs = [
152     platform_list_txt_file,
153   ]
154   outputs = [
155     constructor_list_cc_file,
156   ]
158   args = [
159     "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
160     "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
161     "--namespace=ui",
162     "--typename=OzonePlatform",
163     "--include=\"ui/ozone/public/ozone_platform.h\"",
164   ]
166   deps = [
167     ":generate_ozone_platform_list",
168   ]
171 test("ozone_unittests") {
172   sources = [
173     "run_all_unittests.cc",
174   ]
176   deps = [
177            "//base/test:test_support",
178            "//testing/gtest",
179          ] + ozone_platform_test_deps