Add remoting and PPAPI tests to GN build
[chromium-blink-merge.git] / content / browser / BUILD.gn
blob91fbfee05f57a9bd038b677d3e7346531804236a
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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//content/browser/browser.gni")
9 import("//media/media_options.gni")
11 source_set("browser") {
12   # Only the public target should depend on this. All other targets (even
13   # internal content ones) should depend on the public one.
14   visibility = [ "//content/public/browser:browser_sources" ]
16   defines = []
17   libs = []
18   ldflags = []
20   # Shared deps. See also non-iOS deps below.
21   deps = [
22     "//base",
23     "//base:base_static",
24     "//content:resources",
25     "//content/browser/service_worker:service_worker_proto",
26     "//content/browser/speech/proto",
27     "//content/public/common:common_sources",
28     "//crypto",
29     "//device/battery",
30     "//device/vibration",
31     "//google_apis",
32     "//net",
33     "//skia",
34     "//sql",
35     "//third_party/npapi",
36     "//third_party/re2",
37     "//third_party/WebKit/public:blink_headers",
38     "//third_party/zlib",
39     "//third_party/zlib:zip",
40     "//ui/accessibility",
41     "//ui/accessibility:ax_gen",
42     "//ui/base",
43     "//ui/base/ime",
44     "//ui/events",
45     "//ui/events:gesture_detection",
46     "//ui/gfx",
47     "//ui/gfx/geometry",
48     "//ui/gl",
49     "//ui/native_theme",
50     "//ui/resources",
51     "//ui/snapshot",
52   ]
54   if (is_ios) {
55     # iOS doesn't get the normal file list and only takes these whitelisted
56     # files.
57     sources = [
58       "browser_context.cc",
59       "browser_main_loop.cc",
60       "browser_main_runner.cc",
61       "browser_process_sub_thread.cc",
62       "browser_thread_impl.cc",
63       "browser_url_handler_impl.cc",
64       "cert_store_impl.cc",
65       "download/download_create_info.cc",
66       "notification_service_impl.cc",
67       "signed_certificate_timestamp_store_impl.cc",
68       "user_metrics.cc",
69       "web_contents/navigation_entry_impl.cc",
70     ]
71   } else {
72     # Normal non-iOS sources get everything.
73     sources = rebase_path(content_browser_gypi_values.private_browser_sources,
74                           ".",
75                           "//content")
77     # TODO(GYP) these generated files are listed as sources in content_browser.
78     # This is a bit suspicious. The GN grit template will make a source set
79     # containing the generated code so it should be sufficient to just depend
80     # on the grit rule. But maybe some of these will need to be added?
81     #
82     # Need this annoying rebase_path call to match what happened with the
83     # sources.
84     sources -= rebase_path(
85             [
86               "$root_gen_dir/blink/grit/devtools_resources.h",
87               "$root_gen_dir/blink/grit/devtools_resources_map.cc",
88               "$root_gen_dir/blink/grit/devtools_resources_map.h",
89               "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.cc",
90               "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.h",
91               "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
92               "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
93             ],
94             ".")
96     # Non-iOS deps.
97     deps += [
98       "//cc",
99       "//cc/surfaces",
100       "//content/app/resources",
101       "//content/app/strings",
102       "//content/browser/devtools:resources",
103       "//content/common:mojo_bindings",
104       "//content/public/common:mojo_bindings",
105       "//device/bluetooth",
106       "//net:http_server",
107       "//storage/browser",
108       "//storage/common",
109       "//third_party/WebKit/public:resources",
110       "//third_party/angle:commit_id",
111       "//third_party/icu",
112       "//third_party/leveldatabase",
113       "//third_party/libyuv",
114       "//third_party/mojo/src/mojo/public/cpp/bindings",
115       "//third_party/mojo/src/mojo/public/interfaces/application",
116       "//third_party/mojo/src/mojo/public/js",
117       "//ui/resources",
118       "//ui/surface",
119       "//ui/touch_selection",
120     ]
121   }
123   configs += [ "//content:content_implementation" ]
125   if (toolkit_views) {
126     deps += [ "//ui/events" ]
127   }
129   if (is_win) {
130     sources += [
131       "power_profiler/power_data_provider_ia_win.cc",
132       "power_profiler/power_data_provider_ia_win.h",
133     ]
134     deps += [ "//third_party/power_gadget" ]
135   } else {
136     sources += [
137       "file_descriptor_info_impl.cc",
138       "file_descriptor_info_impl.h",
139       "power_profiler/power_data_provider_dummy.cc",
140     ]
141     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
142   }
144   if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
145     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
146   }
148   if (enable_basic_printing || enable_print_preview) {
149     deps += [ "//printing" ]
150   }
152   # TODO(GYP)
153   #   ['OS!="ios" and chrome_multiple_dll!=1', {
154   #     'dependencies': [
155   #       '../third_party/WebKit/public/blink.gyp:blink',
156   #     ],
157   #   }],
158   if (!is_mac && !is_ios) {
159     deps += [ "//sandbox" ]
160   }
161   if (!is_android && !is_ios) {
162     deps += [ "//content/browser/tracing:resources" ]
163   }
165   if (enable_webrtc) {
166     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
167                            ".",
168                            "//content")
169     deps += [ "//jingle:jingle_glue" ]
170     if (is_linux) {
171       deps += [ "//third_party/libjingle:libjingle_webrtc" ]
172     }
173     if (is_linux || is_mac || is_win) {
174       sources += [
175         "media/capture/desktop_capture_device.cc",
176         "media/capture/desktop_capture_device.h",
177         "media/capture/desktop_capture_device_uma_types.cc",
178         "media/capture/desktop_capture_device_uma_types.h",
179       ]
180       if (use_aura) {
181         sources += [
182           "media/capture/desktop_capture_device_aura.cc",
183           "media/capture/desktop_capture_device_aura.h",
184         ]
185       }
186       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
187       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
188     }
189   }
191   if (is_win) {
192     sources -= [
193       "device_sensors/data_fetcher_shared_memory_default.cc",
194       "geolocation/empty_wifi_data_provider.cc",
195     ]
196     defines += [
197       # This prevents the inclusion of atlhost.h which paired
198       # with the windows 8 sdk it does the wrong thing.
199       "__ATLHOST_H__",
200     ]
201     deps += [
202       "//third_party/iaccessible2",
203       "//third_party/isimpledom",
204     ]
205     libs += [
206       "comctl32.lib",
207       "dinput8.lib",
208       "dwmapi.lib",
209       "dxguid.lib",
210       "sensorsapi.lib",
211       "portabledeviceguids.lib",
212     ]
214     # TODI(GYP)
215     #       'msvs_settings': {
216     #         'VCLinkerTool': {
217     #           'DelayLoadDLLs': [
218     #             'dinput8.dll',
219     #             'user32.dll',
220     #             'dwmapi.dll',
221     #           ],
222   }
224   if (is_linux) {
225     deps += [ "//sandbox/linux:libc_urandom_override" ]
226   }
228   if (use_udev) {
229     deps += [ "//device/udev_linux" ]
230   } else {
231     # Remove udev-specific sources.
232     sources -= [
233       "device_monitor_udev.cc",
234       "device_monitor_udev.h",
235     ]
236     if (is_linux) {
237       # Already filtered out on non-Linux.
238       sources -= [
239         "gamepad/gamepad_platform_data_fetcher_linux.cc",
240         "udev_linux.cc",
241         "udev_linux.h",
242       ]
243     }
244   }
246   if (enable_plugins) {
247     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
248                            ".",
249                            "//content")
250     deps += [
251       "//ppapi/proxy:ipc",
252       "//ppapi/shared_impl",
253     ]
254     if (!use_ozone || use_pango) {
255       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
256     }
257     if (!use_pango) {
258       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
259     }
260   }
262   if (is_linux && use_aura) {
263     configs += [ "//build/config/linux:fontconfig" ]
264   }
266   if (use_x11) {
267     configs += [ "//build/config/linux:x11" ]
268     deps += [ "//ui/gfx/x" ]
269   }
271   # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated
272   # given the interaction between os_chromeos and the feature flags for X11 and
273   # ozone, so do it all in one spot.
274   if (is_chromeos || !use_ozone) {
275     sources -= [ "power_save_blocker_ozone.cc" ]
276   }
277   if (is_chromeos || !use_x11) {
278     sources -= [ "power_save_blocker_x11.cc" ]
279   }
281   # Dealing with *wifi_data_provider_*.cc is also a bit complicated given
282   # android, chromeos, linux and use_dbus.
283   if (is_android) {
284     sources -= [ "geolocation/wifi_data_provider_common.cc" ]
285   }
286   if (is_chromeos || (is_linux && !use_dbus)) {
287     sources -= [ "geolocation/wifi_data_provider_linux.cc" ]
288   }
289   if (is_linux && use_dbus) {
290     sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
291   }
293   if (use_pango) {
294     configs += [ "//build/config/linux:pangocairo" ]
295   }
297   if (is_android) {
298     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
299                            ".",
300                            "//content")
301     sources -= [
302       "browser_ipc_logging.cc",
303       "device_sensors/data_fetcher_shared_memory_default.cc",
304       "geolocation/network_location_provider.cc",
305       "geolocation/network_location_provider.h",
306       "geolocation/network_location_request.cc",
307       "geolocation/network_location_request.h",
308       "tracing/tracing_ui.cc",
309       "tracing/tracing_ui.h",
311       # Android skips most, but not all, of the speech code.
312       "speech/audio_buffer.cc",
313       "speech/audio_buffer.h",
314       "speech/audio_encoder.cc",
315       "speech/audio_encoder.h",
316       "speech/chunked_byte_buffer.cc",
317       "speech/chunked_byte_buffer.h",
318       "speech/endpointer/endpointer.cc",
319       "speech/endpointer/endpointer.h",
320       "speech/endpointer/energy_endpointer.cc",
321       "speech/endpointer/energy_endpointer.h",
322       "speech/endpointer/energy_endpointer_params.cc",
323       "speech/endpointer/energy_endpointer_params.h",
324       "speech/google_one_shot_remote_engine.cc",
325       "speech/google_one_shot_remote_engine.h",
326       "speech/google_streaming_remote_engine.cc",
327       "speech/google_streaming_remote_engine.h",
328       "speech/speech_recognition_engine.cc",
329       "speech/speech_recognition_engine.h",
330       "speech/speech_recognizer_impl.cc",
331       "speech/speech_recognizer_impl.h",
332     ]
333     deps += [
334       "//content/public/android:jni",
335       "//media",
336       "//mojo/android:libsystem_java",
337       "//ui/android",
338     ]
339     libs += [ "jnigraphics" ]
340   }
342   if (is_mac) {
343     sources -= [
344       "device_sensors/data_fetcher_shared_memory_default.cc",
345       "geolocation/empty_wifi_data_provider.cc",
346       "geolocation/empty_wifi_data_provider.h",
347     ]
348     deps += [ "//ui/accelerated_widget_mac" ]
349     libs += [ "bsm" ]
350   }
352   if (is_chromeos) {
353     sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ]
354     deps += [
355       "//chromeos",
356       "//chromeos:power_manager_proto",
357     ]
358   }
360   if (use_aura) {
361     deps += [
362       "//ui/aura",
363       "//ui/aura_extra",
364       "//ui/strings",
365       "//ui/wm",
366     ]
367   } else {  # Not aura.
368     sources -= [
369       "renderer_host/input/synthetic_gesture_target_aura.cc",
370       "renderer_host/input/synthetic_gesture_target_aura.h",
371       "renderer_host/native_web_keyboard_event_aura.cc",
372       "renderer_host/render_widget_host_view_aura.cc",
373       "renderer_host/render_widget_host_view_aura.h",
374       "renderer_host/ui_events_helper.cc",
375       "renderer_host/ui_events_helper.h",
376       "renderer_host/web_input_event_aura.cc",
377       "renderer_host/web_input_event_aura.h",
378       "web_contents/aura/gesture_nav_simple.cc",
379       "web_contents/aura/gesture_nav_simple.h",
380       "web_contents/aura/overscroll_navigation_overlay.cc",
381       "web_contents/aura/overscroll_navigation_overlay.h",
382       "web_contents/aura/shadow_layer_delegate.cc",
383       "web_contents/aura/shadow_layer_delegate.h",
384       "web_contents/aura/window_slider.cc",
385       "web_contents/aura/window_slider.h",
386       "web_contents/touch_editable_impl_aura.cc",
387       "web_contents/touch_editable_impl_aura.h",
388       "web_contents/web_contents_view_aura.cc",
389       "web_contents/web_contents_view_aura.h",
390     ]
391   }
393   if (use_aura || is_mac) {
394     sources +=
395         rebase_path(content_browser_gypi_values.compositor_browser_sources,
396                     ".",
397                     "//content")
398     if (!use_x11) {
399       sources -= [
400         "compositor/software_output_device_x11.cc",
401         "compositor/software_output_device_x11.h",
402       ]
403     }
405     if (!use_ozone) {
406       sources -= [
407         "compositor/overlay_candidate_validator_ozone.cc",
408         "compositor/overlay_candidate_validator_ozone.h",
409         "compositor/software_output_device_ozone.cc",
410         "compositor/software_output_device_ozone.h",
411       ]
412     }
413     deps += [ "//ui/compositor" ]
414   }
416   if (enable_web_speech) {
417     deps += [
418       "//third_party/flac",
419       "//third_party/speex",
420     ]
421   }
423   if (is_linux && use_dbus) {
424     deps += [ "//dbus" ]
425   }
427   if (enable_browser_cdms) {
428     sources += [
429       "media/cdm/browser_cdm_manager.cc",
430       "media/cdm/browser_cdm_manager.h",
431       "media/media_web_contents_observer.cc",
432       "media/media_web_contents_observer.h",
433     ]
434   }
436   if (is_linux && use_openssl) {
437     deps += [ "//third_party/boringssl" ]
438   }
440   if (enable_media_mojo_renderer) {
441     deps += [ "//media/mojo/services:renderer_service" ]
442   }