aw: Rendering test harness and end-to-end smoke test
[chromium-blink-merge.git] / content / common / BUILD.gn
bloba1ec31f43a6f9e84c6aff2d5459ad3f3e961faf6
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 if (is_chromeos && use_x11 && cpu_arch != "arm") {
11   action("libva_generate_stubs") {
12     extra_header = "gpu/media/va_stub_header.fragment"
14     script = "../../tools/generate_stubs/generate_stubs.py"
15     sources = [
16       "gpu/media/va.sigs",
17     ]
18     inputs = [
19       extra_header,
20     ]
21     stubs_filename_root = "va_stubs"
23     outputs = [
24       "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
25       "$target_gen_dir/gpu/media/$stubs_filename_root.h",
26     ]
27     args = [
28       "-i",
29       rebase_path("$target_gen_dir/gpu/media", root_build_dir),
30       "-o",
31       rebase_path("$target_gen_dir/gpu/media", root_build_dir),
32       "-t",
33       "posix_stubs",
34       "-e",
35       rebase_path(extra_header, root_build_dir),
36       "-s",
37       stubs_filename_root,
38       "-p",
39       "content/common/gpu/media",
40     ]
42     args += rebase_path(sources, root_build_dir)
43   }
46 if (is_mac) {
47   action("libvt_generate_stubs") {
48     extra_header = "gpu/media/vt_stubs_header.fragment"
50     script = "../../tools/generate_stubs/generate_stubs.py"
51     sources = [
52       "gpu/media/vt.sig",
53     ]
54     inputs = [
55       extra_header,
56     ]
57     stubs_filename_root = "vt_stubs"
59     outputs = [
60       "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
61       "$target_gen_dir/gpu/media/$stubs_filename_root.h",
62     ]
63     args = [
64       "-i",
65       rebase_path("$target_gen_dir/gpu/media", root_build_dir),
66       "-o",
67       rebase_path("$target_gen_dir/gpu/media", root_build_dir),
68       "-t",
69       "posix_stubs",
70       "-e",
71       rebase_path(extra_header, root_build_dir),
72       "-s",
73       stubs_filename_root,
74       "-p",
75       "content/common/gpu/media",
76     ]
78     args += rebase_path(sources, root_build_dir)
79   }
82 source_set("common") {
83   # Only the public target should depend on this. All other targets (even
84   # internal content ones) should depend on the public one.
85   visibility = [ "//content/public/common:common_sources" ]
87   sources = rebase_path(content_common_gypi_values.private_common_sources,
88                         ".",
89                         "//content")
91   configs += [ "//content:content_implementation" ]
93   public_deps = [
94     "//gpu/command_buffer/common",
95     "//third_party/WebKit/public:blink_headers",
96   ]
97   deps = [
98     "//base",
99     "//build/util:webkit_version",
100     "//components/tracing",
101     "//gpu/command_buffer/client:gles2_interface",
102     "//gpu/command_buffer/client:gpu_memory_buffer_manager",
103     "//net",
104     "//skia",
105     "//third_party/icu",
106     "//ui/accessibility",
107     "//ui/base",
108     "//ui/events/ipc",
109     "//ui/gfx",
110     "//ui/gfx/geometry",
111     "//ui/gfx/ipc",
112     "//ui/shell_dialogs",
113     "//url",
114     "//third_party/libjingle",
115   ]
117   if (!is_ios) {
118     deps += [
119       "//cc",
120       "//ipc",
121       "//ipc/mojo",
123       # TODO: the dependency on gl_in_process_context should be decoupled from
124       # content and moved to android_webview. See crbug.com/365797.
125       "//gpu/command_buffer/client:gl_in_process_context",
126       "//gpu/command_buffer/client:gles2_c_lib",
127       "//gpu/command_buffer/client:gles2_cmd_helper",
128       "//gpu/command_buffer/client:gles2_implementation",
129       "//gpu/command_buffer/service",
130       "//gpu/ipc",
131       "//gpu/skia_bindings",
132       "//media",
133       "//media:shared_memory_support",
134       "//mojo/edk/system",
135       "//mojo/environment:chromium",
136       "//mojo/public/interfaces/application",
137       "//sandbox",
138       "//storage/browser",
139       "//storage/common",
140       "//third_party/WebKit/public:blink",
141       "//ui/gl",
142       "//webkit/common/gpu",
143     ]
144   }
146   defines = []
147   include_dirs = []
148   libs = []
149   ldflags = []
151   if (is_android && use_seccomp_bpf) {
152     set_sources_assignment_filter([])
153     sources += [
154       "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
155       "sandbox_linux/sandbox_bpf_base_policy_linux.h",
156     ]
157     set_sources_assignment_filter(sources_assignment_filter)
158   }
160   if (is_mac) {
161     sources += [
162                  "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
163                  "gpu/client/gpu_memory_buffer_impl_io_surface.h",
164                ] + get_target_outputs(":libvt_generate_stubs")
166     sources -= [ "plugin_list_posix.cc" ]
168     deps += [
169       ":libvt_generate_stubs",
170       "//content/app/resources",
171       "//content:resources",
172       "//third_party/WebKit/public:resources",
173       "//ui/accelerated_widget_mac",
174     ]
175     libs += [ "QuartzCore.framework" ]
176   }
178   if (is_android) {
179     sources += [
180       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
181       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
182       "gpu/gpu_memory_buffer_factory_surface_texture.cc",
183       "gpu/gpu_memory_buffer_factory_surface_texture.h",
184     ]
186     deps += [
187       "//content/public/android:jni",
188       "//content/public/android:common_aidl",
189     ]
191     libs += [ "android" ]
192   }
194   if (is_ios) {
195     sources -= [ "user_agent.cc" ]
196     assert(false, "Need to add lots of conditions here")
197   }
199   if (use_ozone) {
200     deps += [
201       "//ui/ozone:ozone",
202       "//ui/ozone:ozone_base",
203       "//ui/ozone/gpu",
204     ]
205   } else {
206     sources -= [
207       "cursors/webcursor_ozone.cc",
208       "font_list_ozone.cc",
209       "gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc",
210       "gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h",
211       "gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc",
212       "gpu/gpu_memory_buffer_factory_ozone_native_buffer.h",
213     ]
214   }
216   if (!use_aura) {
217     sources -= [ "cursors/webcursor_aura.cc" ]
218   }
220   if (!use_aura || !use_x11) {
221     sources -= [ "cursors/webcursor_aurax11.cc" ]
222   }
224   if (use_pango) {
225     configs += [ "//build/config/linux:pangocairo" ]
226     if (use_ozone) {
227       # If we're using pango, never use this ozone file (it was removed in all
228       # non-ozone cases above).
229       sources -= [ "font_list_ozone.cc" ]
230     }
231   } else {
232     sources -= [ "font_list_pango.cc" ]
233   }
235   if (use_x11) {
236     include_dirs += [ "//third_party/khronos" ]
237     configs += [ "//build/config/linux:xcomposite" ]
239     if (cpu_arch != "arm" || !is_chromeos) {
240       sources += [
241         "gpu/x_util.cc",
242         "gpu/x_util.h",
243       ]
244     }
245   }
247   if (enable_plugins) {
248     deps += [ "//ppapi:ppapi_shared" ]
249   } else {
250     sources -= [
251       "pepper_file_util.cc",
252       "pepper_file_util.h",
253       "pepper_messages.h",
254       "pepper_plugin_list.cc",
255       "pepper_plugin_list.h",
256       "pepper_renderer_instance_data.cc",
257       "pepper_renderer_instance_data.h",
258       "plugin_list.cc",
259       "plugin_list.h",
260       "plugin_list_posix.cc",
261       "sandbox_util.cc",
262     ]
263   }
265   if (is_android) {
266     sources += [
267       "gpu/media/android_video_decode_accelerator.cc",
268       "gpu/media/android_video_decode_accelerator.h",
269     ]
271     if (enable_webrtc) {
272       deps += [ "//third_party/libyuv" ]
273     }
274   }
276   if (is_chromeos && use_x11) {
277     if (cpu_arch == "arm") {
278       sources += [
279         "gpu/media/exynos_v4l2_video_device.cc",
280         "gpu/media/exynos_v4l2_video_device.h",
281         "gpu/media/tegra_v4l2_video_device.cc",
282         "gpu/media/tegra_v4l2_video_device.h",
283         "gpu/media/v4l2_image_processor.cc",
284         "gpu/media/v4l2_image_processor.h",
285         "gpu/media/v4l2_video_decode_accelerator.cc",
286         "gpu/media/v4l2_video_decode_accelerator.h",
287         "gpu/media/v4l2_video_device.cc",
288         "gpu/media/v4l2_video_device.h",
289         "gpu/media/v4l2_video_encode_accelerator.cc",
290         "gpu/media/v4l2_video_encode_accelerator.h",
291       ]
292       libs = [
293         "EGL",
294         "GLESv2",
295       ]
296     } else {  # !arm
297       sources += [
298                    "gpu/media/h264_dpb.cc",
299                    "gpu/media/h264_dpb.h",
300                    "gpu/media/va_surface.h",
301                    "gpu/media/vaapi_h264_decoder.cc",
302                    "gpu/media/vaapi_h264_decoder.h",
303                    "gpu/media/vaapi_video_decode_accelerator.cc",
304                    "gpu/media/vaapi_video_decode_accelerator.h",
305                    "gpu/media/vaapi_video_encode_accelerator.cc",
306                    "gpu/media/vaapi_video_encode_accelerator.h",
307                    "gpu/media/vaapi_wrapper.cc",
308                    "gpu/media/vaapi_wrapper.h",
309                  ] + get_target_outputs(":libva_generate_stubs")
310       configs += [
311         "//third_party/libva:libva_config",
312         "//third_party/libyuv:libyuv_config",
313       ]
314       deps += [
315         ":libva_generate_stubs",
316         "//media",
317         "//third_party/libyuv",
318       ]
319     }
320   }
322   if (is_win) {
323     sources += [
324       "gpu/media/dxva_video_decode_accelerator.cc",
325       "gpu/media/dxva_video_decode_accelerator.h",
326     ]
327     include_dirs += [ "//third_party/khronos" ]
328     deps += [ "//ui/gl" ]
330     # TODO(GYP): extract_xinput action.
331   }
333   if (!is_win || !use_aura) {
334     sources -= [ "cursors/webcursor_aurawin.cc" ]
335   }
337   if (use_seccomp_bpf) {
338     defines += [ "USE_SECCOMP_BPF" ]
339   } else {
340     if (is_linux) {
341       sources -= [
342         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
343         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
344         "sandbox_linux/bpf_gpu_policy_linux.cc",
345         "sandbox_linux/bpf_gpu_policy_linux.h",
346         "sandbox_linux/bpf_ppapi_policy_linux.cc",
347         "sandbox_linux/bpf_ppapi_policy_linux.h",
348         "sandbox_linux/bpf_renderer_policy_linux.cc",
349         "sandbox_linux/bpf_renderer_policy_linux.h",
350         "sandbox_linux/bpf_utility_policy_linux.cc",
351         "sandbox_linux/bpf_utility_policy_linux.h",
352         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
353         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
354       ]
355     }
356     if (is_android) {
357       sources -= [
358         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
359         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
360       ]
361     }
362   }
365 mojom("mojo_bindings") {
366   sources = [
367     "geolocation_service.mojom",
368     "permission_service.mojom",
369     "render_frame_setup.mojom",
370   ]
372   deps = [
373     "//content/public/common:mojo_bindings",
374     "//mojo/public/interfaces/application:application",
375   ]