• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5import("//build/config/features.gni")
6import("//build/config/ui.gni")
7import("//content/common/common.gni")
8import("//mojo/public/tools/bindings/mojom.gni")
9
10source_set("common") {
11  # Only targets in the content tree can depend directly on this target.
12  visibility = [ "//content/*" ]
13
14  sources = rebase_path(content_common_gypi_values.private_common_sources,
15                        ".", "//content")
16
17  forward_dependent_configs_from = [
18    "//gpu/command_buffer/common",
19    "//third_party/WebKit/public:blink_headers",
20  ]
21
22  configs += [
23    "//content:content_implementation",
24    "//content:libjingle_stub_config",
25  ]
26
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    "//url",
40    "//third_party/WebKit/public:blink_headers",
41    # TODO(GYP) convert these dependencies.
42    #'../third_party/libjingle/libjingle.gyp:libjingle',
43    #'../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
44  ]
45
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      "//ui/gl",
60      "//webkit/browser:storage",
61      "//webkit/common",
62      "//webkit/common:storage",
63      "//webkit/common/gpu",
64      #'../gpu/gpu.gyp:gl_in_process_context',
65      #'../gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings',
66      #'../media/media.gyp:media',
67      #'../media/media.gyp:shared_memory_support',
68      #'../third_party/WebKit/public/blink.gyp:blink',
69    ]
70  }
71
72  defines = []
73  include_dirs = []
74  libs = []
75  ldflags = []
76
77  if (is_android && use_seccomp_bpf) {
78    set_sources_assignment_filter([])
79    sources += [
80      "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
81      "sandbox_linux/sandbox_bpf_base_policy_linux.h",
82    ]
83    set_sources_assignment_filter(sources_assignment_filter)
84  }
85
86  if (is_mac) {
87    sources += [
88      "gpu/client/gpu_memory_buffer_impl_io_surface.cc",
89      "gpu/client/gpu_memory_buffer_impl_io_surface.h",
90    ]
91    sources -= [
92      "plugin_list_posix.cc",
93    ]
94
95    # TODO(GYP) enable when converted to GN.
96    #deps += [
97    #  "//webkit:webkit_resources",
98    #]
99    libs += [ "QuartzCore.framework" ]
100  }
101
102  if (is_android) {
103    sources += [
104      "gpu/client/gpu_memory_buffer_impl_surface_texture.cc",
105      "gpu/client/gpu_memory_buffer_impl_surface_texture.h",
106    ]
107
108    # TODO(GYP) enable when these targets are converted.
109    #deps += [
110    #  "//content:content_jni_headers",
111    #  "//content:common_aidl",
112    #]
113
114    libs += [ "android" ]
115  }
116
117  if (is_ios) {
118    sources -= [ "user_agent.cc" ]
119    assert(false, "Need to add lots of conditions here")
120  }
121
122  if (!use_ozone) {
123    sources -= [
124      "cursors/webcursor_ozone.cc",
125      "font_list_ozone.cc",
126    ]
127  }
128
129  if (!use_aura || !use_x11) {
130    sources -= [ "cursors/webcursor_aurax11.cc" ]
131  }
132
133  if (use_pango) {
134    configs += [ "//build/config/linux:pangocairo" ]
135    if (use_ozone) {
136      # If we're using pango, never use this ozone file (it was removed in all
137      # non-ozone cases above).
138      sources -= [ "font_list_ozone.cc" ]
139    }
140  } else {
141    sources -= [
142      "font_list_pango.cc",
143    ]
144  }
145
146  if (use_x11) {
147    include_dirs += [ "//third_party/khronos" ]
148    configs += [ "//build/config/linux:xcomposite" ]
149
150    if (cpu_arch != "arm" || !is_chromeos) {
151      sources +=[
152        "gpu/x_util.cc",
153        "gpu/x_util.h",
154      ]
155    }
156  }
157
158  if (enable_plugins) {
159    deps += [
160      "//ppapi:ppapi_shared",
161    ]
162  } else {
163    sources -= [
164      "pepper_plugin_list.cc",
165      "pepper_plugin_list.h",
166      "sandbox_util.cc",
167    ]
168  }
169
170  if (is_android) {
171    sources += [
172      "gpu/media/android_video_decode_accelerator.cc",
173      "gpu/media/android_video_decode_accelerator.h",
174    ]
175    deps += [
176      # TODO(GYP) enable once supported in the GN build.
177      #"//media",
178    ]
179
180    if (enable_webrtc) {
181      deps += [ "//third_party/libyuv" ]
182    }
183  }
184
185  if (is_chromeos && use_x11) {
186    if (cpu_arch == "arm") {
187      sources += [
188        "gpu/media/exynos_v4l2_video_device.cc",
189        "gpu/media/exynos_v4l2_video_device.h",
190        "gpu/media/tegra_v4l2_video_device.cc",
191        "gpu/media/tegra_v4l2_video_device.h",
192        "gpu/media/v4l2_image_processor.cc",
193        "gpu/media/v4l2_image_processor.h",
194        "gpu/media/v4l2_video_decode_accelerator.cc",
195        "gpu/media/v4l2_video_decode_accelerator.h",
196        "gpu/media/v4l2_video_device.cc",
197        "gpu/media/v4l2_video_device.h",
198        "gpu/media/v4l2_video_encode_accelerator.cc",
199        "gpu/media/v4l2_video_encode_accelerator.h",
200      ]
201      # TODO(GYP) enable once supported in the GN build.
202      #deps += [ "//media" ]
203      libs = [ "EGL", "GLESv2" ]
204    } else {  # !arm
205      sources += [
206        "gpu/media/h264_dpb.cc",
207        "gpu/media/h264_dpb.h",
208        "gpu/media/va_surface.h",
209        "gpu/media/vaapi_h264_decoder.cc",
210        "gpu/media/vaapi_h264_decoder.h",
211        "gpu/media/vaapi_video_decode_accelerator.cc",
212        "gpu/media/vaapi_video_decode_accelerator.h",
213        "gpu/media/vaapi_wrapper.cc",
214        "gpu/media/vaapi_wrapper.h",
215      ]
216      assert(false, "Implement generate_stubs for libva")
217    }
218  }
219
220  if (is_win) {
221    sources += [
222      "gpu/media/dxva_video_decode_accelerator.cc",
223      "gpu/media/dxva_video_decode_accelerator.h",
224    ]
225    include_dirs += [ "//third_party/khronos" ]
226    deps += [
227      # TODO(GYP) enable once supported in the GN build.
228      #"//media",
229      "//ui/gl",
230    ]
231
232    # TODO(GYP): extract_xinput action.
233  }
234
235  if (!is_win || !use_aura) {
236    sources -= [ "cursors/webcursor_aurawin.cc" ]
237  }
238
239  if (use_seccomp_bpf) {
240    defines += [ "USE_SECCOMP_BPF" ]
241  } else {
242    if (is_linux) {
243      sources -= [
244        "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc",
245        "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h",
246        "sandbox_linux/bpf_gpu_policy_linux.cc",
247        "sandbox_linux/bpf_gpu_policy_linux.h",
248        "sandbox_linux/bpf_ppapi_policy_linux.cc",
249        "sandbox_linux/bpf_ppapi_policy_linux.h",
250        "sandbox_linux/bpf_renderer_policy_linux.cc",
251        "sandbox_linux/bpf_renderer_policy_linux.h",
252        "sandbox_linux/sandbox_bpf_base_policy_linux.cc",
253        "sandbox_linux/sandbox_bpf_base_policy_linux.h",
254      ]
255    }
256    if (is_android) {
257      sources -= [
258        "sandbox_linux/android/sandbox_bpf_base_policy_android.cc",
259        "sandbox_linux/android/sandbox_bpf_base_policy_android.h",
260      ]
261    }
262  }
263}
264
265mojom("mojo_bindings") {
266  sources = [
267    "web_ui_setup.mojom",
268  ]
269}
270