Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / common / BUILD.gn
blobf05ea3b92d05b3ac52ecb1425a1552c2025257d2
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 targets in the content tree can depend directly on this target.
12   visibility = [ "//content/*" ]
14   sources = rebase_path(content_common_gypi_values.private_common_sources,
15                         ".", "//content")
17   forward_dependent_configs_from = [
18     "//gpu/command_buffer/common",
19     "//third_party/WebKit/public:blink_headers",
20   ]
22   configs += [
23     "//content:content_implementation",
24   ]
26   deps = [
27     "//base",
28     "//build/util:webkit_version",
29     "//components/tracing",
30     "//gpu/command_buffer/common",
31     "//net",
32     "//skia",
33     "//third_party/icu",
34     "//ui/accessibility",
35     "//ui/base",
36     "//ui/gfx",
37     "//ui/gfx/geometry",
38     "//ui/gfx/ipc",
39     "//ui/shell_dialogs",
40     "//url",
41     "//third_party/WebKit/public:blink_headers",
42     "//third_party/libjingle",
43   ]
45   if (!is_ios) {
46     deps += [
47       "//cc",
48       "//ipc",
49       "//ipc/mojo",
50       # TODO: the dependency on gl_in_process_context should be decoupled from
51       # content and moved to android_webview. See crbug.com/365797.
52       "//gpu/command_buffer/client:gl_in_process_context",
53       "//gpu/command_buffer/client:gles2_c_lib",
54       "//gpu/command_buffer/client:gles2_implementation",
55       "//gpu/command_buffer/service",
56       "//gpu/ipc",
57       "//gpu/skia_bindings",
58       "//media",
59       "//media:shared_memory_support",
60       "//mojo/environment:chromium",
61       "//mojo/public/interfaces/application",
62       "//mojo/system",
63       "//sandbox",
64       "//third_party/WebKit/public:blink",
65       "//ui/gl",
66       "//webkit/browser:storage",
67       "//webkit/common",
68       "//webkit/common:storage",
69       "//webkit/common/gpu",
70     ]
71   }
73   defines = []
74   include_dirs = []
75   libs = []
76   ldflags = []
78   if (is_android && use_seccomp_bpf) {
79     set_sources_assignment_filter([])
80     sources += [
81       "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
82       "sandbox_linux/sandbox_bpf_base_policy_linux.h",
83     ]
84     set_sources_assignment_filter(sources_assignment_filter)
85   }
87   if (is_mac) {
88     sources += [
89       "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
90       "gpu/client/gpu_memory_buffer_impl_io_surface.h",
91     ]
92     sources -= [
93       "plugin_list_posix.cc",
94     ]
96     deps += [
97       "//content/app/resources",
98       "//content:resources",
99       "//third_party/WebKit/public:resources",
100     ]
101     libs += [ "QuartzCore.framework" ]
102   }
104   if (is_android) {
105     sources += [
106       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
107       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
108     ]
110     # TODO(GYP) enable when these targets are converted.
111     #deps += [
112     #  "//content:content_jni_headers",
113     #  "//content:common_aidl",
114     #]
116     libs += [ "android" ]
117   }
119   if (is_ios) {
120     sources -= [ "user_agent.cc" ]
121     assert(false, "Need to add lots of conditions here")
122   }
124   if (!use_ozone) {
125     sources -= [
126       "cursors/webcursor_ozone.cc",
127       "font_list_ozone.cc",
128       "gpu/gpu_memory_buffer_factory_ozone.cc",
129     ]
130   }
132   if (!use_aura) {
133     sources -= [ "cursors/webcursor_aura.cc" ]
134   }
136   if (!use_aura || !use_x11) {
137     sources -= [ "cursors/webcursor_aurax11.cc" ]
138   }
140   if (use_pango) {
141     configs += [ "//build/config/linux:pangocairo" ]
142     if (use_ozone) {
143       # If we're using pango, never use this ozone file (it was removed in all
144       # non-ozone cases above).
145       sources -= [ "font_list_ozone.cc" ]
146     }
147   } else {
148     sources -= [
149       "font_list_pango.cc",
150     ]
151   }
153   if (use_x11) {
154     sources += [
155       "gpu/gpu_memory_buffer_factory_x11_pixmap.cc",
156       "common/gpu/gpu_memory_buffer_factory_x11_pixmap.h",
157     ]
158     include_dirs += [ "//third_party/khronos" ]
159     configs += [ "//build/config/linux:xcomposite" ]
161     if (cpu_arch != "arm" || !is_chromeos) {
162       sources +=[
163         "gpu/x_util.cc",
164         "gpu/x_util.h",
165       ]
166     }
167   } else {
168     sources -= [
169       "gpu/gpu_memory_buffer_factory_x11.cc",
170     ]
171   }
173   if (enable_plugins) {
174     deps += [
175       "//ppapi:ppapi_shared",
176     ]
177   } else {
178     sources -= [
179       "pepper_plugin_list.cc",
180       "pepper_plugin_list.h",
181       "sandbox_util.cc",
182     ]
183   }
185   if (is_android) {
186     sources += [
187       "gpu/media/android_video_decode_accelerator.cc",
188       "gpu/media/android_video_decode_accelerator.h",
189     ]
191     if (enable_webrtc) {
192       deps += [ "//third_party/libyuv" ]
193     }
194   }
196   if (is_chromeos && use_x11) {
197     if (cpu_arch == "arm") {
198       sources += [
199         "gpu/media/exynos_v4l2_video_device.cc",
200         "gpu/media/exynos_v4l2_video_device.h",
201         "gpu/media/tegra_v4l2_video_device.cc",
202         "gpu/media/tegra_v4l2_video_device.h",
203         "gpu/media/v4l2_image_processor.cc",
204         "gpu/media/v4l2_image_processor.h",
205         "gpu/media/v4l2_video_decode_accelerator.cc",
206         "gpu/media/v4l2_video_decode_accelerator.h",
207         "gpu/media/v4l2_video_device.cc",
208         "gpu/media/v4l2_video_device.h",
209         "gpu/media/v4l2_video_encode_accelerator.cc",
210         "gpu/media/v4l2_video_encode_accelerator.h",
211       ]
212       libs = [ "EGL", "GLESv2" ]
213     } else {  # !arm
214       sources += [
215         "gpu/media/h264_dpb.cc",
216         "gpu/media/h264_dpb.h",
217         "gpu/media/va_surface.h",
218         "gpu/media/vaapi_h264_decoder.cc",
219         "gpu/media/vaapi_h264_decoder.h",
220         "gpu/media/vaapi_video_decode_accelerator.cc",
221         "gpu/media/vaapi_video_decode_accelerator.h",
222         "gpu/media/vaapi_wrapper.cc",
223         "gpu/media/vaapi_wrapper.h",
224       ]
225       assert(false, "Implement generate_stubs for libva")
226     }
227   }
229   if (is_win) {
230     sources += [
231       "gpu/media/dxva_video_decode_accelerator.cc",
232       "gpu/media/dxva_video_decode_accelerator.h",
233     ]
234     include_dirs += [ "//third_party/khronos" ]
235     deps += [
236       "//ui/gl",
237     ]
239     # TODO(GYP): extract_xinput action.
240   }
242   if (!is_win || !use_aura) {
243     sources -= [ "cursors/webcursor_aurawin.cc" ]
244   }
246   if (use_seccomp_bpf) {
247     defines += [ "USE_SECCOMP_BPF" ]
248   } else {
249     if (is_linux) {
250       sources -= [
251         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
252         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
253         "sandbox_linux/bpf_gpu_policy_linux.cc",
254         "sandbox_linux/bpf_gpu_policy_linux.h",
255         "sandbox_linux/bpf_ppapi_policy_linux.cc",
256         "sandbox_linux/bpf_ppapi_policy_linux.h",
257         "sandbox_linux/bpf_renderer_policy_linux.cc",
258         "sandbox_linux/bpf_renderer_policy_linux.h",
259         "sandbox_linux/bpf_utility_policy_linux.cc",
260         "sandbox_linux/bpf_utility_policy_linux.h",
261         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
262         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
263       ]
264     }
265     if (is_android) {
266       sources -= [
267         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
268         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
269       ]
270     }
271   }
274 mojom("mojo_bindings") {
275   sources = [
276     "render_frame_setup.mojom",
277   ]
279   deps = [
280     "//mojo/public/interfaces/application:application",
281   ]