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("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
10 if (is_chromeos && current_cpu != "arm") {
11 action("libva_generate_stubs") {
12 extra_header = "gpu/media/va_stub_header.fragment"
14 script = "../../tools/generate_stubs/generate_stubs.py"
22 sources += [ "gpu/media/va_x11.sigs" ]
25 sources += [ "gpu/media/va_drm.sigs" ]
27 stubs_filename_root = "va_stubs"
30 "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
31 "$target_gen_dir/gpu/media/$stubs_filename_root.h",
35 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
37 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
41 rebase_path(extra_header, root_build_dir),
45 "content/common/gpu/media",
48 args += rebase_path(sources, root_build_dir)
52 if (is_chromeos && use_v4lplugin) {
53 action("libv4l2_generate_stubs") {
54 extra_header = "gpu/media/v4l2_stub_header.fragment"
56 script = "../../tools/generate_stubs/generate_stubs.py"
63 stubs_filename_root = "v4l2_stubs"
66 "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
67 "$target_gen_dir/gpu/media/$stubs_filename_root.h",
71 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
73 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
77 rebase_path(extra_header, root_build_dir),
81 "content/common/gpu/media",
84 args += rebase_path(sources, root_build_dir)
89 action("libvt_generate_stubs") {
90 extra_header = "gpu/media/vt_stubs_header.fragment"
92 script = "../../tools/generate_stubs/generate_stubs.py"
99 stubs_filename_root = "vt_stubs"
102 "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
103 "$target_gen_dir/gpu/media/$stubs_filename_root.h",
107 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
109 rebase_path("$target_gen_dir/gpu/media", root_build_dir),
113 rebase_path(extra_header, root_build_dir),
117 "content/common/gpu/media",
120 args += rebase_path(sources, root_build_dir)
124 source_set("common") {
125 # Only the public target should depend on this. All other targets (even
126 # internal content ones) should depend on the public one.
127 visibility = [ "//content/public/common:common_sources" ]
129 sources = rebase_path(content_common_gypi_values.private_common_sources,
134 "//content:content_implementation",
135 "//build/config/compiler:no_size_t_to_int_warning",
139 "//gpu/command_buffer/common",
140 "//third_party/WebKit/public:blink_headers",
144 "//build/util:webkit_version",
145 "//components/tracing",
146 "//gpu/command_buffer/client:gles2_interface",
147 "//gpu/command_buffer/common:gles2_utils",
151 "//ui/accessibility",
158 "//ui/shell_dialogs",
160 "//third_party/libjingle",
169 # TODO: the dependency on gl_in_process_context should be decoupled from
170 # content and moved to android_webview. See crbug.com/365797.
172 "//gpu/command_buffer/client:gl_in_process_context",
173 "//gpu/command_buffer/client:gles2_c_lib",
174 "//gpu/command_buffer/client:gles2_cmd_helper",
175 "//gpu/command_buffer/client:gles2_implementation",
176 "//gpu/command_buffer/service",
178 "//gpu/skia_bindings",
181 "//media:shared_memory_support",
182 "//mojo/application/public/interfaces",
183 "//mojo/environment:chromium",
186 "//third_party/WebKit/public:blink",
187 "//third_party/mojo/src/mojo/edk/system",
197 if (is_android && use_seccomp_bpf) {
198 set_sources_assignment_filter([])
200 "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
201 "sandbox_linux/sandbox_bpf_base_policy_linux.h",
203 set_sources_assignment_filter(sources_assignment_filter)
208 "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
209 "gpu/client/gpu_memory_buffer_impl_io_surface.h",
210 "gpu/gpu_memory_buffer_factory_io_surface.cc",
211 "gpu/gpu_memory_buffer_factory_io_surface.h",
213 "gpu/media/vt_video_decode_accelerator.cc",
214 "gpu/media/vt_video_decode_accelerator.h",
215 ] + get_target_outputs(":libvt_generate_stubs")
217 sources -= [ "plugin_list_posix.cc" ]
220 ":libvt_generate_stubs",
221 "//content/app/resources",
222 "//content:resources",
223 "//third_party/WebKit/public:image_resources",
224 "//third_party/WebKit/public:resources",
225 "//ui/accelerated_widget_mac",
228 "IOSurface.framework",
230 "QuartzCore.framework",
236 "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
237 "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
238 "gpu/gpu_memory_buffer_factory_surface_texture.cc",
239 "gpu/gpu_memory_buffer_factory_surface_texture.h",
243 "//content/public/android:jni",
244 "//content/public/android:common_aidl",
247 libs += [ "android" ]
250 if (is_debug && !is_component_build) {
251 # Content depends on the PPAPI message logging stuff; if this isn't here,
252 # some unit test binaries won't compile. This only worked in release mode
253 # because logging is disabled there.
254 deps += [ "//ppapi/proxy:ipc_sources" ]
258 sources -= [ "user_agent.cc" ]
259 assert(false, "Need to add lots of conditions here")
265 "//ui/ozone:ozone_base",
270 "cursors/webcursor_ozone.cc",
271 "font_list_ozone.cc",
272 "gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc",
273 "gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h",
274 "gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc",
275 "gpu/gpu_memory_buffer_factory_ozone_native_buffer.h",
280 sources -= [ "cursors/webcursor_aura.cc" ]
283 if (!use_aura || !use_x11) {
284 sources -= [ "cursors/webcursor_aurax11.cc" ]
288 configs += [ "//build/config/linux:pangocairo" ]
290 # If we're using pango, never use this ozone file (it was removed in all
291 # non-ozone cases above).
292 sources -= [ "font_list_ozone.cc" ]
295 sources -= [ "font_list_pango.cc" ]
300 "//build/config/linux:xcomposite",
301 "//third_party/khronos:khronos_headers",
304 if (current_cpu != "arm" || !is_chromeos) {
305 sources += [ "gpu/x_util.h" ]
309 if (enable_plugins) {
310 deps += [ "//ppapi/shared_impl" ]
313 "pepper_file_util.cc",
314 "pepper_file_util.h",
316 "pepper_plugin_list.cc",
317 "pepper_plugin_list.h",
318 "pepper_renderer_instance_data.cc",
319 "pepper_renderer_instance_data.h",
322 "plugin_list_posix.cc",
329 "gpu/media/android_video_decode_accelerator.cc",
330 "gpu/media/android_video_decode_accelerator.h",
334 deps += [ "//third_party/libyuv" ]
340 "gpu/media/accelerated_video_decoder.h",
341 "gpu/media/h264_decoder.cc",
342 "gpu/media/h264_decoder.h",
343 "gpu/media/h264_dpb.cc",
344 "gpu/media/h264_dpb.h",
345 "gpu/media/vp8_decoder.cc",
346 "gpu/media/vp8_decoder.h",
347 "gpu/media/vp8_picture.cc",
348 "gpu/media/vp8_picture.h",
351 defines += [ "USE_LIBV4L2" ]
352 sources += get_target_outputs(":libv4l2_generate_stubs")
353 deps += [ ":libv4l2_generate_stubs" ]
355 if (use_v4l2_codec) {
356 defines += [ "USE_V4L2_CODEC" ]
358 "gpu/media/generic_v4l2_device.cc",
359 "gpu/media/generic_v4l2_device.h",
360 "gpu/media/v4l2_device.cc",
361 "gpu/media/v4l2_device.h",
362 "gpu/media/v4l2_image_processor.cc",
363 "gpu/media/v4l2_image_processor.h",
364 "gpu/media/v4l2_slice_video_decode_accelerator.cc",
365 "gpu/media/v4l2_slice_video_decode_accelerator.h",
366 "gpu/media/v4l2_video_decode_accelerator.cc",
367 "gpu/media/v4l2_video_decode_accelerator.h",
368 "gpu/media/v4l2_video_encode_accelerator.cc",
369 "gpu/media/v4l2_video_encode_accelerator.h",
376 if (current_cpu == "arm") {
378 "gpu/media/tegra_v4l2_device.cc",
379 "gpu/media/tegra_v4l2_device.h",
382 if (current_cpu != "arm") {
384 "gpu/media/va_surface.h",
385 "gpu/media/vaapi_picture.cc",
386 "gpu/media/vaapi_picture.h",
387 "gpu/media/vaapi_video_decode_accelerator.cc",
388 "gpu/media/vaapi_video_decode_accelerator.h",
389 "gpu/media/vaapi_video_encode_accelerator.cc",
390 "gpu/media/vaapi_video_encode_accelerator.h",
391 "gpu/media/vaapi_wrapper.cc",
392 "gpu/media/vaapi_wrapper.h",
393 ] + get_target_outputs(":libva_generate_stubs")
395 "//third_party/libva:libva_config",
396 "//third_party/libyuv:libyuv_config",
399 ":libva_generate_stubs",
401 "//third_party/libyuv",
405 "gpu/media/vaapi_tfp_picture.cc",
406 "gpu/media/vaapi_tfp_picture.h",
411 "gpu/media/vaapi_drm_picture.cc",
412 "gpu/media/vaapi_drm_picture.h",
420 "gpu/media/dxva_video_decode_accelerator.cc",
421 "gpu/media/dxva_video_decode_accelerator.h",
423 configs += [ "//third_party/khronos:khronos_headers" ]
424 deps += [ "//ui/gl" ]
435 "/DELAYLOAD:d3d9.dll",
436 "/DELAYLOAD:d3d11.dll",
437 "/DELAYLOAD:dxva2.dll",
439 "/DELAYLOAD:mfplat.dll",
442 # TODO(GYP): extract_xinput action.
445 if (!is_win || !use_aura) {
446 sources -= [ "cursors/webcursor_aurawin.cc" ]
449 if (use_seccomp_bpf) {
450 defines += [ "USE_SECCOMP_BPF" ]
454 "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
455 "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
456 "sandbox_linux/bpf_gpu_policy_linux.cc",
457 "sandbox_linux/bpf_gpu_policy_linux.h",
458 "sandbox_linux/bpf_ppapi_policy_linux.cc",
459 "sandbox_linux/bpf_ppapi_policy_linux.h",
460 "sandbox_linux/bpf_renderer_policy_linux.cc",
461 "sandbox_linux/bpf_renderer_policy_linux.h",
462 "sandbox_linux/bpf_utility_policy_linux.cc",
463 "sandbox_linux/bpf_utility_policy_linux.h",
464 "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
465 "sandbox_linux/sandbox_bpf_base_policy_linux.h",
470 "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
471 "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
476 if (is_win && current_cpu == "x64") {
477 # TODO(jschuh): Remove this after crbug.com/173851 gets fixed.
478 cflags = [ "/bigobj" ]
482 mojom("mojo_bindings") {
484 "application_setup.mojom",
485 "background_sync_service.mojom",
486 "geolocation_service.mojom",
487 "permission_service.mojom",
488 "presentation/presentation_service.mojom",
489 "process_control.mojom",
490 "render_frame_setup.mojom",
493 import_dirs = [ "//mojo/services" ]
496 "//content/public/common:mojo_bindings",
497 "//mojo/application/public/interfaces",