Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / ui / ozone / BUILD.gn
bloba11bb7f7fe60a698892e43ecb1740ee7fe55e851
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_gbm) {
33   ozone_platforms += [ "gbm" ]
34   ozone_platform_deps += [ "platform/drm:gbm" ]
35   ozone_platform_test_deps += [ "platform/drm:gbm_unittests" ]
38 platform_list_cc_file = "$target_gen_dir/platform_list.cc"
39 platform_list_h_file = "$target_gen_dir/platform_list.h"
40 platform_list_txt_file = "$target_gen_dir/platform_list.txt"
41 constructor_list_cc_file = "$target_gen_dir/constructor_list.cc"
43 # GYP version: ui/ozone/ozone.gyp:ozone_base
44 component("ozone_base") {
45   sources = [
46     "public/cursor_factory_ozone.cc",
47     "public/cursor_factory_ozone.h",
48     "public/gpu_platform_support.cc",
49     "public/gpu_platform_support.h",
50     "public/gpu_platform_support_host.cc",
51     "public/gpu_platform_support_host.h",
52     "public/overlay_candidates_ozone.cc",
53     "public/overlay_candidates_ozone.h",
54     "public/overlay_manager_ozone.h",
55     "public/surface_factory_ozone.cc",
56     "public/surface_factory_ozone.h",
57     "public/surface_ozone_canvas.h",
58     "public/surface_ozone_egl.cc",
59     "public/surface_ozone_egl.h",
60     "public/system_input_injector.h",
61   ]
63   defines = [ "OZONE_BASE_IMPLEMENTATION" ]
65   deps = [
66     "//base",
67     "//skia",
68     "//ui/gfx/geometry",
69   ]
72 component("ozone") {
73   sources = [
74     "common/display_mode_proxy.cc",
75     "common/display_mode_proxy.h",
76     "common/display_snapshot_proxy.cc",
77     "common/display_snapshot_proxy.h",
78     "common/display_util.cc",
79     "common/display_util.h",
80     "common/egl_util.cc",
81     "common/egl_util.h",
82     "common/gpu/ozone_gpu_message_generator.cc",
83     "common/gpu/ozone_gpu_message_generator.h",
84     "common/gpu/ozone_gpu_message_params.cc",
85     "common/gpu/ozone_gpu_message_params.h",
86     "common/gpu/ozone_gpu_messages.h",
87     "common/native_display_delegate_ozone.cc",
88     "common/native_display_delegate_ozone.h",
89     "common/stub_client_native_pixmap_factory.cc",
90     "common/stub_client_native_pixmap_factory.h",
91     "common/stub_overlay_manager.cc",
92     "common/stub_overlay_manager.h",
93     "platform_selection.cc",
94     "platform_selection.h",
95     "public/client_native_pixmap_factory.cc",
96     "public/client_native_pixmap_factory.h",
97     "public/input_controller.cc",
98     "public/input_controller.h",
99     "public/ozone_gpu_test_helper.cc",
100     "public/ozone_gpu_test_helper.h",
101     "public/ozone_platform.cc",
102     "public/ozone_platform.h",
103     "public/ozone_switches.cc",
104     "public/ozone_switches.h",
105     constructor_list_cc_file,
106     platform_list_cc_file,
107     platform_list_h_file,
108   ]
110   defines = [ "OZONE_IMPLEMENTATION" ]
112   deps =
113       [
114         ":generate_constructor_list",
115         ":generate_ozone_platform_list",
116         ":ozone_base",
117         "//base",
118         "//ipc",
119         "//skia",
120         "//ui/display/types",
121         "//ui/display/util",
122         "//ui/events",
123         "//ui/events/ozone:events_ozone",
124         "//ui/gfx",
125         "//ui/gfx/geometry",
126         "//ui/gfx/ipc",
128         # TODO(GYP) the GYP version has a way to add additional dependencies via
129         # build flags.
130       ] + ozone_platform_deps
133 # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list
134 action("generate_ozone_platform_list") {
135   script = "generate_ozone_platform_list.py"
136   outputs = [
137     platform_list_cc_file,
138     platform_list_h_file,
139     platform_list_txt_file,
140   ]
142   args =
143       [
144         "--output_cc=" + rebase_path(platform_list_cc_file, root_build_dir),
145         "--output_h=" + rebase_path(platform_list_h_file, root_build_dir),
146         "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir),
147         "--default=$ozone_platform",
148       ] + ozone_platforms
151 # GYP version: ui/ozone/ozone.gyp:generate_constructor_list
152 action("generate_constructor_list") {
153   script = "generate_constructor_list.py"
155   inputs = [
156     platform_list_txt_file,
157   ]
158   outputs = [
159     constructor_list_cc_file,
160   ]
162   args = [
163     "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
164     "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
165     "--namespace=ui",
166     "--typename=OzonePlatform",
167     "--typename=ClientNativePixmapFactory",
168     "--include=\"ui/ozone/public/ozone_platform.h\"",
169     "--include=\"ui/ozone/public/client_native_pixmap_factory.h\"",
170   ]
172   deps = [
173     ":generate_ozone_platform_list",
174   ]
177 test("ozone_unittests") {
178   sources = [
179     "run_all_unittests.cc",
180   ]
182   deps = [
183            "//base/test:test_support",
184            "//testing/gtest",
185            "//ui/gfx/geometry",
186          ] + ozone_platform_test_deps