[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / content / common / BUILD.gn
blob66d78a600cc21dee2b0adc607bcdc66e2f67c835
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     "//content:libjingle_stub_config",
25   ]
27   deps = [
28     "//base",
29     "//build/util:webkit_version",
30     "//components/tracing",
31     "//gpu/command_buffer/common",
32     "//net",
33     "//skia",
34     "//third_party/icu",
35     "//ui/accessibility",
36     "//ui/base",
37     "//ui/gfx",
38     "//ui/gfx/geometry",
39     "//ui/shell_dialogs",
40     "//url",
41     "//third_party/WebKit/public:blink_headers",
42     # TODO(GYP) convert these dependencies.
43     #'../third_party/libjingle/libjingle.gyp:libjingle',
44   ]
46   if (!is_ios) {
47     deps += [
48       "//cc",
49       "//ipc",
50       "//mojo/environment:chromium",
51       "//mojo/system",
52       # TODO: the dependency on gl_in_process_context should be decoupled from
53       # content and moved to android_webview. See crbug.com/365797.
54       "//gpu/command_buffer/client:gl_in_process_context",
55       "//gpu/command_buffer/client:gles2_c_lib",
56       "//gpu/command_buffer/client:gles2_implementation",
57       "//gpu/command_buffer/service",
58       "//gpu/ipc",
59       "//mojo/public/interfaces/service_provider",
60       "//ui/gl",
61       "//webkit/browser:storage",
62       "//webkit/common",
63       "//webkit/common:storage",
64       "//webkit/common/gpu",
65       #'../gpu/gpu.gyp:gl_in_process_context',
66       #'../gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings',
67       #'../media/media.gyp:media',
68       #'../media/media.gyp:shared_memory_support',
69       #'../third_party/WebKit/public/blink.gyp:blink',
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       "//webkit:resources",
98       "//content:resources",
99     ]
100     libs += [ "QuartzCore.framework" ]
101   }
103   if (is_android) {
104     sources += [
105       "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
106       "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
107     ]
109     # TODO(GYP) enable when these targets are converted.
110     #deps += [
111     #  "//content:content_jni_headers",
112     #  "//content:common_aidl",
113     #]
115     libs += [ "android" ]
116   }
118   if (is_ios) {
119     sources -= [ "user_agent.cc" ]
120     assert(false, "Need to add lots of conditions here")
121   }
123   if (!use_ozone) {
124     sources -= [
125       "cursors/webcursor_ozone.cc",
126       "font_list_ozone.cc",
127     ]
128   }
130   if (!use_aura) {
131     sources -= [ "cursors/webcursor_aura.cc" ]
132   }
134   if (!use_aura || !use_x11) {
135     sources -= [ "cursors/webcursor_aurax11.cc" ]
136   }
138   if (use_pango) {
139     configs += [ "//build/config/linux:pangocairo" ]
140     if (use_ozone) {
141       # If we're using pango, never use this ozone file (it was removed in all
142       # non-ozone cases above).
143       sources -= [ "font_list_ozone.cc" ]
144     }
145   } else {
146     sources -= [
147       "font_list_pango.cc",
148     ]
149   }
151   if (use_x11) {
152     include_dirs += [ "//third_party/khronos" ]
153     configs += [ "//build/config/linux:xcomposite" ]
155     if (cpu_arch != "arm" || !is_chromeos) {
156       sources +=[
157         "gpu/x_util.cc",
158         "gpu/x_util.h",
159       ]
160     }
161   }
163   if (enable_plugins) {
164     deps += [
165       "//ppapi:ppapi_shared",
166     ]
167   } else {
168     sources -= [
169       "pepper_plugin_list.cc",
170       "pepper_plugin_list.h",
171       "sandbox_util.cc",
172     ]
173   }
175   if (is_android) {
176     sources += [
177       "gpu/media/android_video_decode_accelerator.cc",
178       "gpu/media/android_video_decode_accelerator.h",
179     ]
180     deps += [
181       # TODO(GYP) enable once supported in the GN build.
182       #"//media",
183     ]
185     if (enable_webrtc) {
186       deps += [ "//third_party/libyuv" ]
187     }
188   }
190   if (is_chromeos && use_x11) {
191     if (cpu_arch == "arm") {
192       sources += [
193         "gpu/media/exynos_v4l2_video_device.cc",
194         "gpu/media/exynos_v4l2_video_device.h",
195         "gpu/media/tegra_v4l2_video_device.cc",
196         "gpu/media/tegra_v4l2_video_device.h",
197         "gpu/media/v4l2_image_processor.cc",
198         "gpu/media/v4l2_image_processor.h",
199         "gpu/media/v4l2_video_decode_accelerator.cc",
200         "gpu/media/v4l2_video_decode_accelerator.h",
201         "gpu/media/v4l2_video_device.cc",
202         "gpu/media/v4l2_video_device.h",
203         "gpu/media/v4l2_video_encode_accelerator.cc",
204         "gpu/media/v4l2_video_encode_accelerator.h",
205       ]
206       # TODO(GYP) enable once supported in the GN build.
207       #deps += [ "//media" ]
208       libs = [ "EGL", "GLESv2" ]
209     } else {  # !arm
210       sources += [
211         "gpu/media/h264_dpb.cc",
212         "gpu/media/h264_dpb.h",
213         "gpu/media/va_surface.h",
214         "gpu/media/vaapi_h264_decoder.cc",
215         "gpu/media/vaapi_h264_decoder.h",
216         "gpu/media/vaapi_video_decode_accelerator.cc",
217         "gpu/media/vaapi_video_decode_accelerator.h",
218         "gpu/media/vaapi_wrapper.cc",
219         "gpu/media/vaapi_wrapper.h",
220       ]
221       assert(false, "Implement generate_stubs for libva")
222     }
223   }
225   if (is_win) {
226     sources += [
227       "gpu/media/dxva_video_decode_accelerator.cc",
228       "gpu/media/dxva_video_decode_accelerator.h",
229     ]
230     include_dirs += [ "//third_party/khronos" ]
231     deps += [
232       # TODO(GYP) enable once supported in the GN build.
233       #"//media",
234       "//ui/gl",
235     ]
237     # TODO(GYP): extract_xinput action.
238   }
240   if (!is_win || !use_aura) {
241     sources -= [ "cursors/webcursor_aurawin.cc" ]
242   }
244   if (use_seccomp_bpf) {
245     defines += [ "USE_SECCOMP_BPF" ]
246   } else {
247     if (is_linux) {
248       sources -= [
249         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
250         "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
251         "sandbox_linux/bpf_gpu_policy_linux.cc",
252         "sandbox_linux/bpf_gpu_policy_linux.h",
253         "sandbox_linux/bpf_ppapi_policy_linux.cc",
254         "sandbox_linux/bpf_ppapi_policy_linux.h",
255         "sandbox_linux/bpf_renderer_policy_linux.cc",
256         "sandbox_linux/bpf_renderer_policy_linux.h",
257         "sandbox_linux/bpf_utility_policy_linux.cc",
258         "sandbox_linux/bpf_utility_policy_linux.h",
259         "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
260         "sandbox_linux/sandbox_bpf_base_policy_linux.h",
261       ]
262     }
263     if (is_android) {
264       sources -= [
265         "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
266         "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
267       ]
268     }
269   }
272 mojom("mojo_bindings") {
273   sources = [
274     "render_frame_setup.mojom",
275   ]
277   deps = [
278     "//mojo/public/interfaces/service_provider:service_provider",
279   ]