ServiceWorker: Send state change events via SWProviderHost
[chromium-blink-merge.git] / ui / ozone / BUILD.gn
blob543f81cd6edac25648e488f10cb12887773954e2
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) {
33   ozone_platforms += [ "dri" ]
34   ozone_platform_deps += [ "platform/dri" ]
35   ozone_platform_test_deps += [ "platform/dri:dri_unittests" ]
38 if (ozone_platform_gbm) {
39   ozone_platforms += [ "gbm" ]
40   ozone_platform_deps += [ "platform/dri:gbm" ]
43 platform_list_cc_file = "$target_gen_dir/platform_list.cc"
44 platform_list_h_file = "$target_gen_dir/platform_list.h"
45 platform_list_txt_file = "$target_gen_dir/platform_list.txt"
46 constructor_list_cc_file = "$target_gen_dir/constructor_list.cc"
48 # GYP version: ui/ozone/ozone.gyp:ozone_base
49 component("ozone_base") {
50   sources = [
51     "public/cursor_factory_ozone.cc",
52     "public/cursor_factory_ozone.h",
53     "public/gpu_platform_support.cc",
54     "public/gpu_platform_support.h",
55     "public/gpu_platform_support_host.cc",
56     "public/gpu_platform_support_host.h",
57     "public/overlay_candidates_ozone.cc",
58     "public/overlay_candidates_ozone.h",
59     "public/surface_factory_ozone.cc",
60     "public/surface_factory_ozone.h",
61     "public/surface_ozone_canvas.h",
62     "public/surface_ozone_egl.h",
63     "public/system_input_injector.h",
64   ]
66   defines = [ "OZONE_BASE_IMPLEMENTATION" ]
68   deps = [
69     "//base",
70     "//skia",
71     "//ui/gfx/geometry",
72   ]
75 component("ozone") {
76   sources = [
77     platform_list_cc_file,
78     platform_list_h_file,
79     constructor_list_cc_file,
80     "common/display_mode_proxy.cc",
81     "common/display_mode_proxy.h",
82     "common/display_snapshot_proxy.cc",
83     "common/display_snapshot_proxy.h",
84     "common/display_util.cc",
85     "common/display_util.h",
86     "common/egl_util.cc",
87     "common/egl_util.h",
88     "common/gpu/ozone_gpu_message_generator.cc",
89     "common/gpu/ozone_gpu_message_generator.h",
90     "common/gpu/ozone_gpu_message_params.cc",
91     "common/gpu/ozone_gpu_message_params.h",
92     "common/gpu/ozone_gpu_messages.h",
93     "common/native_display_delegate_ozone.cc",
94     "common/native_display_delegate_ozone.h",
95     "public/input_controller.cc",
96     "public/input_controller.h",
97     "public/ozone_platform.cc",
98     "public/ozone_platform.h",
99     "public/ozone_switches.cc",
100     "public/ozone_switches.h",
101     "public/ui_thread_gpu.cc",
102     "public/ui_thread_gpu.h",
103     "platform_selection.cc",
104     "platform_selection.h",
105   ]
107   defines = [ "OZONE_IMPLEMENTATION" ]
109   deps =
110       [
111         ":generate_constructor_list",
112         ":generate_ozone_platform_list",
113         ":ozone_base",
114         "//base",
115         "//ipc",
116         "//skia",
117         "//ui/display/types",
118         "//ui/display/util",
119         "//ui/events",
120         "//ui/events/ozone:events_ozone",
121         "//ui/gfx",
122         "//ui/gfx/geometry",
123         "//ui/gfx/ipc",
125         # TODO(GYP) the GYP version has a way to add additional dependencies via
126         # build flags.
127       ] + ozone_platform_deps
130 # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list
131 action("generate_ozone_platform_list") {
132   script = "generate_ozone_platform_list.py"
133   outputs = [
134     platform_list_cc_file,
135     platform_list_h_file,
136     platform_list_txt_file,
137   ]
139   args =
140       [
141         "--output_cc=" + rebase_path(platform_list_cc_file, root_build_dir),
142         "--output_h=" + rebase_path(platform_list_h_file, root_build_dir),
143         "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir),
144         "--default=$ozone_platform",
145       ] + ozone_platforms
148 # GYP version: ui/ozone/ozone.gyp:generate_constructor_list
149 action("generate_constructor_list") {
150   script = "generate_constructor_list.py"
152   inputs = [
153     platform_list_txt_file,
154   ]
155   outputs = [
156     constructor_list_cc_file,
157   ]
159   args = [
160     "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
161     "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
162     "--namespace=ui",
163     "--typename=OzonePlatform",
164     "--include=\"ui/ozone/public/ozone_platform.h\"",
165   ]
167   deps = [
168     ":generate_ozone_platform_list",
169   ]
172 test("ozone_unittests") {
173   sources = [
174     "run_all_unittests.cc",
175   ]
177   deps = [
178            "//base/test:test_support",
179            "//testing/gtest",
180          ] + ozone_platform_test_deps