Revert of Integrate SIMD optimisations for zlib (patchset #14 id:280001 of https...
[chromium-blink-merge.git] / content / common / BUILD.gn
blob7d0cf0fda134a93b55cbc04f0339381c27af9a71
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 = [ "gpu/media/va.sigs" ]
16     source_prereqs = [ extra_header ]
17     stubs_filename_root = "va_stubs"
19     outputs = [
20       "$target_gen_dir/gpu/media/$stubs_filename_root.cc",
21       "$target_gen_dir/gpu/media/$stubs_filename_root.h",
22     ]
23     args = [
24       "-i", rebase_path("$target_gen_dir/gpu/media", root_build_dir),
25       "-o", rebase_path("$target_gen_dir/gpu/media", root_build_dir),
26       "-t", "posix_stubs",
27       "-e", rebase_path(extra_header, root_build_dir),
28       "-s", stubs_filename_root,
29       "-p", "content/common/gpu/media",
30     ]
32     args += rebase_path(sources, root_build_dir)
33   }
36 source_set("common") {
37   # Only the public target should depend on this. All other targets (even
38   # internal content ones) should depend on the public one.
39   visibility = [ "//content/public/common:common_sources" ]
41   sources = rebase_path(content_common_gypi_values.private_common_sources,
42                         ".", "//content")
44   configs += [
45     "//content:content_implementation",
46   ]
48   public_deps = [
49     "//gpu/command_buffer/common",
50     "//third_party/WebKit/public:blink_headers",
51   ]
52   deps = [
53     "//base",
54     "//build/util:webkit_version",
55     "//components/tracing",
56     "//gpu/command_buffer/client:gles2_interface",
57     "//net",
58     "//skia",
59     "//third_party/icu",
60     "//ui/accessibility",
61     "//ui/base",
62     "//ui/gfx",
63     "//ui/gfx/geometry",
64     "//ui/gfx/ipc",
65     "//ui/shell_dialogs",
66     "//url",
67     "//third_party/libjingle",
68   ]
70   if (!is_ios) {
71     deps += [
72       "//cc",
73       "//ipc",
74       "//ipc/mojo",
75       # TODO: the dependency on gl_in_process_context should be decoupled from
76       # content and moved to android_webview. See crbug.com/365797.
77       "//gpu/command_buffer/client:gl_in_process_context",
78       "//gpu/command_buffer/client:gles2_c_lib",
79       "//gpu/command_buffer/client:gles2_cmd_helper",
80       "//gpu/command_buffer/client:gles2_implementation",
81       "//gpu/command_buffer/service",
82       "//gpu/ipc",
83       "//gpu/skia_bindings",
84       "//media",
85       "//media:shared_memory_support",
86       "//mojo/edk/system",
87       "//mojo/environment:chromium",
88       "//mojo/public/interfaces/application",
89       "//sandbox",
90       "//storage/browser",
91       "//storage/common",
92       "//third_party/WebKit/public:blink",
93       "//ui/gl",
94       "//webkit/common/gpu",
95     ]
96   }
98   defines = []
99   include_dirs = []
100   libs = []
101   ldflags = []
103   if (is_android && use_seccomp_bpf) {
104     set_sources_assignment_filter([])
105     sources += [
106       "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
107       "sandbox_linux/sandbox_bpf_base_policy_linux.h",
108     ]
109     set_sources_assignment_filter(sources_assignment_filter)
110   }
112   if (is_mac) {
113     sources += [
114       "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
115       "gpu/client/gpu_memory_buffer_impl_io_surface.h",
116     ]
117     sources -= [
118       "plugin_list_posix.cc",
119     ]
121     deps += [
122       "//content/app/resources",
123       "//content:resources",
124       "//third_party/WebKit/public:resources",
125     ]
126     libs += [ "QuartzCore.framework" ]
127   }
129   if (is_android) {
130     sources += [
131       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
132       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
133       "gpu/gpu_memory_buffer_factory_surface_texture.cc",
134       "gpu/gpu_memory_buffer_factory_surface_texture.h",
135     ]
137     deps += [
138       "//content/public/android:jni",
139       "//content/public/android:common_aidl",
140     ]
142     libs += [ "android" ]
143   }
145   if (is_ios) {
146     sources -= [ "user_agent.cc" ]
147     assert(false, "Need to add lots of conditions here")
148   }
150   if (!use_ozone) {
151     sources -= [
152       "cursors/webcursor_ozone.cc",
153       "font_list_ozone.cc",
154       "gpu/gpu_memory_buffer_factory_ozone.cc",
155     ]
156   }
158   if (!use_aura) {
159     sources -= [ "cursors/webcursor_aura.cc" ]
160   }
162   if (!use_aura || !use_x11) {
163     sources -= [ "cursors/webcursor_aurax11.cc" ]
164   }
166   if (use_pango) {
167     configs += [ "//build/config/linux:pangocairo" ]
168     if (use_ozone) {
169       # If we're using pango, never use this ozone file (it was removed in all
170       # non-ozone cases above).
171       sources -= [ "font_list_ozone.cc" ]
172     }
173   } else {
174     sources -= [
175       "font_list_pango.cc",
176     ]
177   }
179   if (use_x11) {
180     sources += [
181       "gpu/gpu_memory_buffer_factory_x11_pixmap.cc",
182       "common/gpu/gpu_memory_buffer_factory_x11_pixmap.h",
183     ]
184     include_dirs += [ "//third_party/khronos" ]
185     configs += [ "//build/config/linux:xcomposite" ]
187     if (cpu_arch != "arm" || !is_chromeos) {
188       sources +=[
189         "gpu/x_util.cc",
190         "gpu/x_util.h",
191       ]
192     }
193   } else {
194     sources -= [
195       "gpu/gpu_memory_buffer_factory_x11.cc",
196     ]
197   }
199   if (enable_plugins) {
200     deps += [
201       "//ppapi:ppapi_shared",
202     ]
203   } else {
204     sources -= [
205       "pepper_file_util.cc",
206       "pepper_file_util.h",
207       "pepper_messages.h",
208       "pepper_plugin_list.cc",
209       "pepper_plugin_list.h",
210       "pepper_renderer_instance_data.cc",
211       "pepper_renderer_instance_data.h",
212       "plugin_list.cc",
213       "plugin_list.h",
214       "plugin_list_posix.cc",
215       "sandbox_util.cc",
216     ]
217   }
219   if (is_android) {
220     sources += [
221       "gpu/media/android_video_decode_accelerator.cc",
222       "gpu/media/android_video_decode_accelerator.h",
223     ]
225     if (enable_webrtc) {
226       deps += [ "//third_party/libyuv" ]
227     }
228   }
230   if (is_chromeos && use_x11) {
231     if (cpu_arch == "arm") {
232       sources += [
233         "gpu/media/exynos_v4l2_video_device.cc",
234         "gpu/media/exynos_v4l2_video_device.h",
235         "gpu/media/tegra_v4l2_video_device.cc",
236         "gpu/media/tegra_v4l2_video_device.h",
237         "gpu/media/v4l2_image_processor.cc",
238         "gpu/media/v4l2_image_processor.h",
239         "gpu/media/v4l2_video_decode_accelerator.cc",
240         "gpu/media/v4l2_video_decode_accelerator.h",
241         "gpu/media/v4l2_video_device.cc",
242         "gpu/media/v4l2_video_device.h",
243         "gpu/media/v4l2_video_encode_accelerator.cc",
244         "gpu/media/v4l2_video_encode_accelerator.h",
245       ]
246       libs = [ "EGL", "GLESv2" ]
247     } else {  # !arm
248       sources += [
249         "gpu/media/h264_dpb.cc",
250         "gpu/media/h264_dpb.h",
251         "gpu/media/va_surface.h",
252         "gpu/media/vaapi_h264_decoder.cc",
253         "gpu/media/vaapi_h264_decoder.h",
254         "gpu/media/vaapi_video_decode_accelerator.cc",
255         "gpu/media/vaapi_video_decode_accelerator.h",
256         "gpu/media/vaapi_video_encode_accelerator.cc",
257         "gpu/media/vaapi_video_encode_accelerator.h",
258         "gpu/media/vaapi_wrapper.cc",
259         "gpu/media/vaapi_wrapper.h",
260       ] + get_target_outputs(":libva_generate_stubs")
261       configs += [
262         "//third_party/libva:libva_config",
263         "//third_party/libyuv:libyuv_config",
264       ]
265       deps += [
266         ":libva_generate_stubs",
267         "//media",
268         "//third_party/libyuv",
269       ]
270     }
271   }
273   if (is_win) {
274     sources += [
275       "gpu/media/dxva_video_decode_accelerator.cc",
276       "gpu/media/dxva_video_decode_accelerator.h",
277     ]
278     include_dirs += [ "//third_party/khronos" ]
279     deps += [
280       "//ui/gl",
281     ]
283     # TODO(GYP): extract_xinput action.
284   }
286   if (!is_win || !use_aura) {
287     sources -= [ "cursors/webcursor_aurawin.cc" ]
288   }
290   if (use_seccomp_bpf) {
291     defines += [ "USE_SECCOMP_BPF" ]
292   } else {
293     if (is_linux) {
294       sources -= [
295         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
296         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
297         "sandbox_linux/bpf_gpu_policy_linux.cc",
298         "sandbox_linux/bpf_gpu_policy_linux.h",
299         "sandbox_linux/bpf_ppapi_policy_linux.cc",
300         "sandbox_linux/bpf_ppapi_policy_linux.h",
301         "sandbox_linux/bpf_renderer_policy_linux.cc",
302         "sandbox_linux/bpf_renderer_policy_linux.h",
303         "sandbox_linux/bpf_utility_policy_linux.cc",
304         "sandbox_linux/bpf_utility_policy_linux.h",
305         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
306         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
307       ]
308     }
309     if (is_android) {
310       sources -= [
311         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
312         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
313       ]
314     }
315   }
318 mojom("mojo_bindings") {
319   sources = [
320     "render_frame_setup.mojom",
321   ]
323   deps = [
324     "//mojo/public/interfaces/application:application",
325   ]