Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / common / BUILD.gn
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.
4
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")
9
10 if (is_chromeos && use_x11 && cpu_arch != "arm") {
11   action("libva_generate_stubs") {
12     extra_header = "gpu/media/va_stub_header.fragment"
13
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"
18
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     ]
31
32     args += rebase_path(sources, root_build_dir)
33   }
34 }
35
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" ]
40
41   sources = rebase_path(content_common_gypi_values.private_common_sources,
42                         ".", "//content")
43
44   configs += [
45     "//content:content_implementation",
46   ]
47
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     "//gpu/command_buffer/client:gpu_memory_buffer_manager",
58     "//net",
59     "//skia",
60     "//third_party/icu",
61     "//ui/accessibility",
62     "//ui/base",
63     "//ui/events/ipc",
64     "//ui/gfx",
65     "//ui/gfx/geometry",
66     "//ui/gfx/ipc",
67     "//ui/shell_dialogs",
68     "//url",
69     "//third_party/libjingle",
70   ]
71
72   if (!is_ios) {
73     deps += [
74       "//cc",
75       "//ipc",
76       "//ipc/mojo",
77       # TODO: the dependency on gl_in_process_context should be decoupled from
78       # content and moved to android_webview. See crbug.com/365797.
79       "//gpu/command_buffer/client:gl_in_process_context",
80       "//gpu/command_buffer/client:gles2_c_lib",
81       "//gpu/command_buffer/client:gles2_cmd_helper",
82       "//gpu/command_buffer/client:gles2_implementation",
83       "//gpu/command_buffer/service",
84       "//gpu/ipc",
85       "//gpu/skia_bindings",
86       "//media",
87       "//media:shared_memory_support",
88       "//mojo/edk/system",
89       "//mojo/environment:chromium",
90       "//mojo/public/interfaces/application",
91       "//sandbox",
92       "//storage/browser",
93       "//storage/common",
94       "//third_party/WebKit/public:blink",
95       "//ui/gl",
96       "//webkit/common/gpu",
97     ]
98   }
99
100   defines = []
101   include_dirs = []
102   libs = []
103   ldflags = []
104
105   if (is_android && use_seccomp_bpf) {
106     set_sources_assignment_filter([])
107     sources += [
108       "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
109       "sandbox_linux/sandbox_bpf_base_policy_linux.h",
110     ]
111     set_sources_assignment_filter(sources_assignment_filter)
112   }
113
114   if (is_mac) {
115     sources += [
116       "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
117       "gpu/client/gpu_memory_buffer_impl_io_surface.h",
118     ]
119     sources -= [
120       "plugin_list_posix.cc",
121     ]
122
123     deps += [
124       "//content/app/resources",
125       "//content:resources",
126       "//third_party/WebKit/public:resources",
127     ]
128     libs += [ "QuartzCore.framework" ]
129   }
130
131   if (is_android) {
132     sources += [
133       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
134       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
135       "gpu/gpu_memory_buffer_factory_surface_texture.cc",
136       "gpu/gpu_memory_buffer_factory_surface_texture.h",
137     ]
138
139     deps += [
140       "//content/public/android:jni",
141       "//content/public/android:common_aidl",
142     ]
143
144     libs += [ "android" ]
145   }
146
147   if (is_ios) {
148     sources -= [ "user_agent.cc" ]
149     assert(false, "Need to add lots of conditions here")
150   }
151
152   if (!use_ozone) {
153     sources -= [
154       "cursors/webcursor_ozone.cc",
155       "font_list_ozone.cc",
156       "gpu/gpu_memory_buffer_factory_ozone.cc",
157     ]
158   } else {
159     sources -= [
160       "gpu/gpu_memory_buffer_factory_linux.cc",
161     ]
162     deps += [
163       "//ui/ozone/gpu",
164     ]
165   }
166
167   if (!use_aura) {
168     sources -= [ "cursors/webcursor_aura.cc" ]
169   }
170
171   if (!use_aura || !use_x11) {
172     sources -= [ "cursors/webcursor_aurax11.cc" ]
173   }
174
175   if (use_pango) {
176     configs += [ "//build/config/linux:pangocairo" ]
177     if (use_ozone) {
178       # If we're using pango, never use this ozone file (it was removed in all
179       # non-ozone cases above).
180       sources -= [ "font_list_ozone.cc" ]
181     }
182   } else {
183     sources -= [
184       "font_list_pango.cc",
185     ]
186   }
187
188   if (use_x11) {
189     include_dirs += [ "//third_party/khronos" ]
190     configs += [ "//build/config/linux:xcomposite" ]
191
192     if (cpu_arch != "arm" || !is_chromeos) {
193       sources +=[
194         "gpu/x_util.cc",
195         "gpu/x_util.h",
196       ]
197     }
198   }
199
200   if (enable_plugins) {
201     deps += [
202       "//ppapi:ppapi_shared",
203     ]
204   } else {
205     sources -= [
206       "pepper_file_util.cc",
207       "pepper_file_util.h",
208       "pepper_messages.h",
209       "pepper_plugin_list.cc",
210       "pepper_plugin_list.h",
211       "pepper_renderer_instance_data.cc",
212       "pepper_renderer_instance_data.h",
213       "plugin_list.cc",
214       "plugin_list.h",
215       "plugin_list_posix.cc",
216       "sandbox_util.cc",
217     ]
218   }
219
220   if (is_android) {
221     sources += [
222       "gpu/media/android_video_decode_accelerator.cc",
223       "gpu/media/android_video_decode_accelerator.h",
224     ]
225
226     if (enable_webrtc) {
227       deps += [ "//third_party/libyuv" ]
228     }
229   }
230
231   if (is_chromeos && use_x11) {
232     if (cpu_arch == "arm") {
233       sources += [
234         "gpu/media/exynos_v4l2_video_device.cc",
235         "gpu/media/exynos_v4l2_video_device.h",
236         "gpu/media/tegra_v4l2_video_device.cc",
237         "gpu/media/tegra_v4l2_video_device.h",
238         "gpu/media/v4l2_image_processor.cc",
239         "gpu/media/v4l2_image_processor.h",
240         "gpu/media/v4l2_video_decode_accelerator.cc",
241         "gpu/media/v4l2_video_decode_accelerator.h",
242         "gpu/media/v4l2_video_device.cc",
243         "gpu/media/v4l2_video_device.h",
244         "gpu/media/v4l2_video_encode_accelerator.cc",
245         "gpu/media/v4l2_video_encode_accelerator.h",
246       ]
247       libs = [ "EGL", "GLESv2" ]
248     } else {  # !arm
249       sources += [
250         "gpu/media/h264_dpb.cc",
251         "gpu/media/h264_dpb.h",
252         "gpu/media/va_surface.h",
253         "gpu/media/vaapi_h264_decoder.cc",
254         "gpu/media/vaapi_h264_decoder.h",
255         "gpu/media/vaapi_video_decode_accelerator.cc",
256         "gpu/media/vaapi_video_decode_accelerator.h",
257         "gpu/media/vaapi_video_encode_accelerator.cc",
258         "gpu/media/vaapi_video_encode_accelerator.h",
259         "gpu/media/vaapi_wrapper.cc",
260         "gpu/media/vaapi_wrapper.h",
261       ] + get_target_outputs(":libva_generate_stubs")
262       configs += [
263         "//third_party/libva:libva_config",
264         "//third_party/libyuv:libyuv_config",
265       ]
266       deps += [
267         ":libva_generate_stubs",
268         "//media",
269         "//third_party/libyuv",
270       ]
271     }
272   }
273
274   if (is_win) {
275     sources += [
276       "gpu/media/dxva_video_decode_accelerator.cc",
277       "gpu/media/dxva_video_decode_accelerator.h",
278     ]
279     include_dirs += [ "//third_party/khronos" ]
280     deps += [
281       "//ui/gl",
282     ]
283
284     # TODO(GYP): extract_xinput action.
285   }
286
287   if (!is_win || !use_aura) {
288     sources -= [ "cursors/webcursor_aurawin.cc" ]
289   }
290
291   if (use_seccomp_bpf) {
292     defines += [ "USE_SECCOMP_BPF" ]
293   } else {
294     if (is_linux) {
295       sources -= [
296         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
297         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
298         "sandbox_linux/bpf_gpu_policy_linux.cc",
299         "sandbox_linux/bpf_gpu_policy_linux.h",
300         "sandbox_linux/bpf_ppapi_policy_linux.cc",
301         "sandbox_linux/bpf_ppapi_policy_linux.h",
302         "sandbox_linux/bpf_renderer_policy_linux.cc",
303         "sandbox_linux/bpf_renderer_policy_linux.h",
304         "sandbox_linux/bpf_utility_policy_linux.cc",
305         "sandbox_linux/bpf_utility_policy_linux.h",
306         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
307         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
308       ]
309     }
310     if (is_android) {
311       sources -= [
312         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
313         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
314       ]
315     }
316   }
317 }
318
319 mojom("mojo_bindings") {
320   sources = [
321     "geolocation_service.mojom",
322     "render_frame_setup.mojom",
323   ]
324
325   deps = [
326     "//content/public/common:mojo_bindings",
327     "//mojo/public/interfaces/application:application",
328   ]
329 }