Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / ozone / BUILD.gn
blobb23cf66a821b18e1b72a2a5f2933636ee42aca12
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   ]
64   defines = [ "OZONE_BASE_IMPLEMENTATION" ]
66   deps = [
67     "//base",
68     "//skia",
69     "//ui/gfx/geometry",
70   ]
73 component("ozone") {
74   sources = [
75     platform_list_cc_file,
76     platform_list_h_file,
77     constructor_list_cc_file,
79     # common/chromeos files are excluded automatically when building with
80     # chromeos=0, by exclusion rules in filename_rules.gypi due to the
81     # "chromeos" folder name.
82     "common/chromeos/display_mode_proxy.cc",
83     "common/chromeos/display_mode_proxy.h",
84     "common/chromeos/display_snapshot_proxy.cc",
85     "common/chromeos/display_snapshot_proxy.h",
86     "common/chromeos/display_util.cc",
87     "common/chromeos/display_util.h",
88     "common/chromeos/native_display_delegate_ozone.cc",
89     "common/chromeos/native_display_delegate_ozone.h",
90     "common/chromeos/touchscreen_device_manager_ozone.cc",
91     "common/chromeos/touchscreen_device_manager_ozone.h",
92     "common/gpu/ozone_gpu_message_generator.cc",
93     "common/gpu/ozone_gpu_message_generator.h",
94     "common/gpu/ozone_gpu_message_params.cc",
95     "common/gpu/ozone_gpu_message_params.h",
96     "common/gpu/ozone_gpu_messages.h",
97     "public/ozone_platform.cc",
98     "public/ozone_platform.h",
99     "public/ozone_switches.cc",
100     "public/ozone_switches.h",
101     "platform_selection.cc",
102     "platform_selection.h",
103   ]
105   defines = [ "OZONE_IMPLEMENTATION" ]
107   deps = [
108     ":generate_constructor_list",
109     ":generate_ozone_platform_list",
110     ":ozone_base",
111     "//base",
112     "//ipc",
113     "//skia",
114     "//ui/events",
115     "//ui/events/ozone:events_ozone",
116     "//ui/gfx",
117     "//ui/gfx/geometry",
118     "//ui/gfx/ipc",
119     # TODO(GYP) the GYP version has a way to add additional dependencies via
120     # build flags.
121   ] + ozone_platform_deps
123   if (is_chromeos) {
124     deps += [ "//ui/dusplay/types" ]
125   }
128 # GYP version: ui/ozone/ozone.gyp:generate_ozone_platform_list
129 action("generate_ozone_platform_list") {
130   script = "generate_ozone_platform_list.py"
131   outputs = [
132     platform_list_cc_file,
133     platform_list_h_file,
134     platform_list_txt_file
135   ]
137   args = [
138     "--output_cc=" + rebase_path(platform_list_cc_file, root_build_dir),
139     "--output_h=" + rebase_path(platform_list_h_file, root_build_dir),
140     "--output_txt=" + rebase_path(platform_list_txt_file, root_build_dir),
141     "--default=$ozone_platform",
142   ] + ozone_platforms
145 # GYP version: ui/ozone/ozone.gyp:generate_constructor_list
146 action("generate_constructor_list") {
147   script = "generate_constructor_list.py"
149   source_prereqs = [
150     platform_list_txt_file,
151   ]
152   outputs = [
153     constructor_list_cc_file,
154   ]
156   args = [
157     "--platform_list=" + rebase_path(platform_list_txt_file, root_build_dir),
158     "--output_cc=" + rebase_path(constructor_list_cc_file, root_build_dir),
159     "--namespace=ui",
160     "--typename=OzonePlatform",
161     "--include=\"ui/ozone/public/ozone_platform.h\"",
162   ]
164   deps = [ ":generate_ozone_platform_list" ]
167 test("ozone_unittests") {
168   sources = [
169     "run_all_unittests.cc",
170   ]
172   deps = [
173     "//base/test:test_support",
174     "//testing/gtest",
175   ] + ozone_platform_test_deps