Removing uses of X11 native key events.
[chromium-blink-merge.git] / content / common / BUILD.gn
blobb302866db084aa19e232563ad8c7188edd5be8fc
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("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//content/common/common.gni")
8 import("//mojo/public/tools/bindings/mojom.gni")
10 source_set("common") {
11   # Only the public target should depend on this. All other targets (even
12   # internal content ones) should depend on the public one.
13   visibility = [ "//content/public/common:common_sources" ]
15   sources = rebase_path(content_common_gypi_values.private_common_sources,
16                         ".", "//content")
18   forward_dependent_configs_from = [
19     "//gpu/command_buffer/common",
20     "//third_party/WebKit/public:blink_headers",
21   ]
23   configs += [
24     "//content:content_implementation",
25   ]
27   deps = [
28     "//base",
29     "//build/util:webkit_version",
30     "//components/tracing",
31     "//gpu/command_buffer/client:gles2_interface",
32     "//gpu/command_buffer/common",
33     "//net",
34     "//skia",
35     "//third_party/icu",
36     "//ui/accessibility",
37     "//ui/base",
38     "//ui/gfx",
39     "//ui/gfx/geometry",
40     "//ui/gfx/ipc",
41     "//ui/shell_dialogs",
42     "//url",
43     "//third_party/WebKit/public:blink_headers",
44     "//third_party/libjingle",
45   ]
47   if (!is_ios) {
48     deps += [
49       "//cc",
50       "//ipc",
51       "//ipc/mojo",
52       # TODO: the dependency on gl_in_process_context should be decoupled from
53       # content and moved to android_webview. See crbug.com/365797.
54       "//gpu/command_buffer/client:gl_in_process_context",
55       "//gpu/command_buffer/client:gles2_c_lib",
56       "//gpu/command_buffer/client:gles2_cmd_helper",
57       "//gpu/command_buffer/client:gles2_implementation",
58       "//gpu/command_buffer/service",
59       "//gpu/ipc",
60       "//gpu/skia_bindings",
61       "//media",
62       "//media:shared_memory_support",
63       "//mojo/environment:chromium",
64       "//mojo/public/interfaces/application",
65       "//mojo/system",
66       "//sandbox",
67       "//storage/browser",
68       "//storage/common",
69       "//third_party/WebKit/public:blink",
70       "//ui/gl",
71       "//webkit/common/gpu",
72     ]
73   }
75   defines = []
76   include_dirs = []
77   libs = []
78   ldflags = []
80   if (is_android && use_seccomp_bpf) {
81     set_sources_assignment_filter([])
82     sources += [
83       "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
84       "sandbox_linux/sandbox_bpf_base_policy_linux.h",
85     ]
86     set_sources_assignment_filter(sources_assignment_filter)
87   }
89   if (is_mac) {
90     sources += [
91       "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
92       "gpu/client/gpu_memory_buffer_impl_io_surface.h",
93     ]
94     sources -= [
95       "plugin_list_posix.cc",
96     ]
98     deps += [
99       "//content/app/resources",
100       "//content:resources",
101       "//third_party/WebKit/public:resources",
102     ]
103     libs += [ "QuartzCore.framework" ]
104   }
106   if (is_android) {
107     sources += [
108       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
109       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
110     ]
112     deps += [
113       "//content/public/android:jni",
114       "//content/public/android:common_aidl",
115     ]
117     libs += [ "android" ]
118   }
120   if (is_ios) {
121     sources -= [ "user_agent.cc" ]
122     assert(false, "Need to add lots of conditions here")
123   }
125   if (!use_ozone) {
126     sources -= [
127       "cursors/webcursor_ozone.cc",
128       "font_list_ozone.cc",
129       "gpu/gpu_memory_buffer_factory_ozone.cc",
130     ]
131   }
133   if (!use_aura) {
134     sources -= [ "cursors/webcursor_aura.cc" ]
135   }
137   if (!use_aura || !use_x11) {
138     sources -= [ "cursors/webcursor_aurax11.cc" ]
139   }
141   if (use_pango) {
142     configs += [ "//build/config/linux:pangocairo" ]
143     if (use_ozone) {
144       # If we're using pango, never use this ozone file (it was removed in all
145       # non-ozone cases above).
146       sources -= [ "font_list_ozone.cc" ]
147     }
148   } else {
149     sources -= [
150       "font_list_pango.cc",
151     ]
152   }
154   if (use_x11) {
155     sources += [
156       "gpu/gpu_memory_buffer_factory_x11_pixmap.cc",
157       "common/gpu/gpu_memory_buffer_factory_x11_pixmap.h",
158     ]
159     include_dirs += [ "//third_party/khronos" ]
160     configs += [ "//build/config/linux:xcomposite" ]
162     if (cpu_arch != "arm" || !is_chromeos) {
163       sources +=[
164         "gpu/x_util.cc",
165         "gpu/x_util.h",
166       ]
167     }
168   } else {
169     sources -= [
170       "gpu/gpu_memory_buffer_factory_x11.cc",
171     ]
172   }
174   if (enable_plugins) {
175     deps += [
176       "//ppapi:ppapi_shared",
177     ]
178   } else {
179     sources -= [
180       "pepper_file_util.cc",
181       "pepper_file_util.h",
182       "pepper_messages.h",
183       "pepper_plugin_list.cc",
184       "pepper_plugin_list.h",
185       "pepper_renderer_instance_data.cc",
186       "pepper_renderer_instance_data.h",
187       "plugin_list.cc",
188       "plugin_list.h",
189       "plugin_list_posix.cc",
190       "sandbox_util.cc",
191     ]
192   }
194   if (is_android) {
195     sources += [
196       "gpu/media/android_video_decode_accelerator.cc",
197       "gpu/media/android_video_decode_accelerator.h",
198     ]
200     if (enable_webrtc) {
201       deps += [ "//third_party/libyuv" ]
202     }
203   }
205   if (is_chromeos && use_x11) {
206     if (cpu_arch == "arm") {
207       sources += [
208         "gpu/media/exynos_v4l2_video_device.cc",
209         "gpu/media/exynos_v4l2_video_device.h",
210         "gpu/media/tegra_v4l2_video_device.cc",
211         "gpu/media/tegra_v4l2_video_device.h",
212         "gpu/media/v4l2_image_processor.cc",
213         "gpu/media/v4l2_image_processor.h",
214         "gpu/media/v4l2_video_decode_accelerator.cc",
215         "gpu/media/v4l2_video_decode_accelerator.h",
216         "gpu/media/v4l2_video_device.cc",
217         "gpu/media/v4l2_video_device.h",
218         "gpu/media/v4l2_video_encode_accelerator.cc",
219         "gpu/media/v4l2_video_encode_accelerator.h",
220       ]
221       libs = [ "EGL", "GLESv2" ]
222     } else {  # !arm
223       sources += [
224         "gpu/media/h264_dpb.cc",
225         "gpu/media/h264_dpb.h",
226         "gpu/media/va_surface.h",
227         "gpu/media/vaapi_h264_decoder.cc",
228         "gpu/media/vaapi_h264_decoder.h",
229         "gpu/media/vaapi_video_decode_accelerator.cc",
230         "gpu/media/vaapi_video_decode_accelerator.h",
231         "gpu/media/vaapi_wrapper.cc",
232         "gpu/media/vaapi_wrapper.h",
233       ]
234       assert(false, "Implement generate_stubs for libva")
235     }
236   }
238   if (is_win) {
239     sources += [
240       "gpu/media/dxva_video_decode_accelerator.cc",
241       "gpu/media/dxva_video_decode_accelerator.h",
242     ]
243     include_dirs += [ "//third_party/khronos" ]
244     deps += [
245       "//ui/gl",
246     ]
248     # TODO(GYP): extract_xinput action.
249   }
251   if (!is_win || !use_aura) {
252     sources -= [ "cursors/webcursor_aurawin.cc" ]
253   }
255   if (use_seccomp_bpf) {
256     defines += [ "USE_SECCOMP_BPF" ]
257   } else {
258     if (is_linux) {
259       sources -= [
260         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
261         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
262         "sandbox_linux/bpf_gpu_policy_linux.cc",
263         "sandbox_linux/bpf_gpu_policy_linux.h",
264         "sandbox_linux/bpf_ppapi_policy_linux.cc",
265         "sandbox_linux/bpf_ppapi_policy_linux.h",
266         "sandbox_linux/bpf_renderer_policy_linux.cc",
267         "sandbox_linux/bpf_renderer_policy_linux.h",
268         "sandbox_linux/bpf_utility_policy_linux.cc",
269         "sandbox_linux/bpf_utility_policy_linux.h",
270         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
271         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
272       ]
273     }
274     if (is_android) {
275       sources -= [
276         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
277         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
278       ]
279     }
280   }
283 mojom("mojo_bindings") {
284   sources = [
285     "render_frame_setup.mojom",
286   ]
288   deps = [
289     "//mojo/public/interfaces/application:application",
290   ]