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/python.gni")
6import("//build/util/process_version.gni")
7import("//remoting/build/config/remoting_build.gni")
8
9group("all_tests") {
10  testonly = true
11
12  deps = [ ":unit_tests" ]
13}
14
15group("all") {
16  testonly = true
17
18  deps = [ ":host" ]
19  if (enable_me2me_host) {
20    deps += [ "//remoting/host:remoting_me2me_host" ]
21  }
22
23  if (is_chrome_branded) {
24    deps += [ ":remoting_host_branded" ]
25  }
26
27  if (!is_chromeos && !is_android && !is_ios) {
28    deps += [
29      "//remoting/host:remoting_native_messaging_host",
30      "//remoting/host:remoting_native_messaging_manifests",
31      "//remoting/host:remoting_start_host",
32      "//remoting/host/it2me:remote_assistance_host",
33    ]
34  }
35}
36
37process_version("remoting_version") {
38  template_file = "//remoting/host/version.h.in"
39  sources = [ branding_path ]
40  output = "$target_gen_dir/version.h"
41}
42
43source_set("host") {
44  public_deps = [ ":common" ]
45  deps = [ "//remoting/host/file_transfer" ]
46}
47
48source_set("base") {
49  sources = [
50    "host_exit_codes.cc",
51    "host_exit_codes.h",
52    "logging.h",
53    "switches.cc",
54    "switches.h",
55    "username.cc",
56    "username.h",
57  ]
58  deps = [
59    "//base",
60    "//remoting/base",
61  ]
62
63  if (is_linux || is_chromeos) {
64    sources += [ "logging_linux.cc" ]
65  }
66
67  if (is_mac) {
68    sources += [ "logging_mac.cc" ]
69  }
70
71  if (is_win) {
72    sources += [ "logging_win.cc" ]
73  }
74}
75
76# This must be a static library instead of a source set because
77# remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
78# which in turn depends on remoting_me2me_host_static which isn't part of that
79# build.
80#
81# TODO fix this, successful builds should not depend on static libraries
82# stripping code.
83static_library("common") {
84  sources = [
85    "action_executor.cc",
86    "action_executor.h",
87    "action_message_handler.cc",
88    "action_message_handler.h",
89    "audio_capturer.cc",
90    "audio_capturer.h",
91    "audio_silence_detector.cc",
92    "audio_silence_detector.h",
93    "audio_volume_filter.cc",
94    "audio_volume_filter.h",
95    "backoff_timer.cc",
96    "backoff_timer.h",
97    "basic_desktop_environment.cc",
98    "basic_desktop_environment.h",
99    "branding.cc",
100    "branding.h",
101    "chromoting_host.cc",
102    "chromoting_host.h",
103    "chromoting_host_context.cc",
104    "chromoting_host_context.h",
105    "chromoting_messages.cc",
106    "chromoting_messages.h",
107    "chromoting_param_traits.cc",
108    "chromoting_param_traits.h",
109    "chromoting_param_traits_impl.h",
110    "client_session.cc",
111    "client_session.h",
112    "client_session_control.h",
113    "client_session_details.h",
114    "clipboard.h",
115    "config_file_watcher.cc",
116    "config_file_watcher.h",
117    "config_watcher.h",
118    "continue_window.cc",
119    "continue_window.h",
120    "current_process_stats_agent.cc",
121    "current_process_stats_agent.h",
122    "curtain_mode.h",
123    "daemon_process.cc",
124    "daemon_process.h",
125    "desktop_and_cursor_conditional_composer.cc",
126    "desktop_and_cursor_conditional_composer.h",
127    "desktop_capturer_checker.cc",
128    "desktop_capturer_checker.h",
129    "desktop_capturer_proxy.cc",
130    "desktop_capturer_proxy.h",
131    "desktop_display_info.cc",
132    "desktop_display_info.h",
133    "desktop_environment.h",
134    "desktop_environment_options.cc",
135    "desktop_environment_options.h",
136    "desktop_process.cc",
137    "desktop_process.h",
138    "desktop_resizer.h",
139    "desktop_session.cc",
140    "desktop_session.h",
141    "desktop_session_agent.cc",
142    "desktop_session_agent.h",
143    "desktop_session_connector.h",
144    "desktop_session_proxy.cc",
145    "desktop_session_proxy.h",
146    "evaluate_capability.cc",
147    "evaluate_capability.h",
148    "forward_process_stats_agent.cc",
149    "forward_process_stats_agent.h",
150    "ftl_echo_message_listener.cc",
151    "ftl_echo_message_listener.h",
152    "ftl_host_change_notification_listener.cc",
153    "ftl_host_change_notification_listener.h",
154    "ftl_signaling_connector.cc",
155    "ftl_signaling_connector.h",
156    "heartbeat_sender.cc",
157    "heartbeat_sender.h",
158    "host_attributes.cc",
159    "host_attributes.h",
160    "host_config.cc",
161    "host_config.h",
162    "host_details.cc",
163    "host_details.h",
164    "host_event_logger.h",
165    "host_experiment_session_plugin.cc",
166    "host_experiment_session_plugin.h",
167    "host_export.h",
168    "host_extension.h",
169    "host_extension_session.h",
170    "host_extension_session_manager.cc",
171    "host_extension_session_manager.h",
172    "host_power_save_blocker.cc",
173    "host_power_save_blocker.h",
174    "host_secret.cc",
175    "host_secret.h",
176    "host_status_logger.cc",
177    "host_status_logger.h",
178    "host_status_monitor.cc",
179    "host_status_monitor.h",
180    "host_status_observer.h",
181    "host_window.cc",
182    "host_window.h",
183    "host_window_proxy.cc",
184    "host_window_proxy.h",
185    "input_injector.h",
186    "ipc_action_executor.cc",
187    "ipc_action_executor.h",
188    "ipc_audio_capturer.cc",
189    "ipc_audio_capturer.h",
190    "ipc_constants.cc",
191    "ipc_constants.h",
192    "ipc_desktop_environment.cc",
193    "ipc_desktop_environment.h",
194    "ipc_host_event_logger.cc",
195    "ipc_host_event_logger.h",
196    "ipc_input_injector.cc",
197    "ipc_input_injector.h",
198    "ipc_keyboard_layout_monitor.cc",
199    "ipc_keyboard_layout_monitor.h",
200    "ipc_mouse_cursor_monitor.cc",
201    "ipc_mouse_cursor_monitor.h",
202    "ipc_screen_controls.cc",
203    "ipc_screen_controls.h",
204    "ipc_video_frame_capturer.cc",
205    "ipc_video_frame_capturer.h",
206    "it2me_desktop_environment.cc",
207    "it2me_desktop_environment.h",
208    "keyboard_layout_monitor.cc",
209    "keyboard_layout_monitor.h",
210    "mouse_cursor_monitor_proxy.cc",
211    "mouse_cursor_monitor_proxy.h",
212    "mouse_shape_pump.cc",
213    "mouse_shape_pump.h",
214    "pairing_registry_delegate.cc",
215    "pairing_registry_delegate.h",
216    "pin_hash.cc",
217    "pin_hash.h",
218    "pointer_lock_detector.cc",
219    "pointer_lock_detector.h",
220    "policy_watcher.cc",
221    "policy_watcher.h",
222    "process_stats_agent.h",
223    "process_stats_sender.cc",
224    "process_stats_sender.h",
225    "register_support_host_request.h",
226    "remote_input_filter.cc",
227    "remote_input_filter.h",
228    "remoting_register_support_host_request.cc",
229    "remoting_register_support_host_request.h",
230    "resizing_host_observer.cc",
231    "resizing_host_observer.h",
232    "resources.h",
233    "sas_injector.h",
234    "screen_controls.h",
235    "screen_resolution.cc",
236    "screen_resolution.h",
237    "server_log_entry_host.cc",
238    "server_log_entry_host.h",
239    "shutdown_watchdog.cc",
240    "shutdown_watchdog.h",
241    "test_echo_extension.cc",
242    "test_echo_extension.h",
243    "test_echo_extension_session.cc",
244    "test_echo_extension_session.h",
245    "third_party_auth_config.cc",
246    "third_party_auth_config.h",
247    "token_validator_base.cc",
248    "token_validator_base.h",
249    "token_validator_factory_impl.cc",
250    "token_validator_factory_impl.h",
251    "usage_stats_consent.h",
252    "xmpp_register_support_host_request.cc",
253    "xmpp_register_support_host_request.h",
254    "xsession_chooser_ui.inc",
255    "zombie_host_detector.cc",
256    "zombie_host_detector.h",
257  ]
258
259  libs = []
260
261  configs += [
262    "//build/config/compiler:wexit_time_destructors",
263    "//remoting/build/config:version",
264  ]
265
266  defines = [ "WEBRTC_CHROMIUM_BUILD" ]
267
268  deps = [
269    ":base",
270    "//base:i18n",
271    "//build:branding_buildflags",
272    "//components/policy/core/common",
273    "//crypto",
274    "//google_apis",
275    "//media",
276    "//remoting/base",
277    "//remoting/base:authorization",
278    "//remoting/host/file_transfer:common",
279    "//remoting/host/input_monitor",
280    "//remoting/host/security_key",
281    "//remoting/proto/remoting/v1:remote_support_host_messages",
282    "//remoting/protocol",
283    "//remoting/resources",
284    "//services/network:network_service",
285    "//third_party/webrtc_overrides:webrtc_component",
286
287    # //remoting uses the power_save_blocker directly. See crbug.com/689423
288    "//services/device/wake_lock/power_save_blocker",
289    "//ui/base",
290    "//ui/events:dom_keycode_converter",
291    "//ui/events/platform",
292  ]
293
294  public_deps = [
295    "//ipc",
296    "//remoting/proto",
297    "//remoting/proto/remoting/v1:directory_proto",
298  ]
299
300  if (is_posix) {
301    sources += [
302      "host_event_logger_posix.cc",
303      "posix/signal_handler.cc",
304      "posix/signal_handler.h",
305    ]
306  }
307
308  if (!is_ios) {
309    deps += [ "//components/policy:generated" ]
310  }
311
312  if (is_linux && !is_chromeos) {
313    sources += [ "desktop_resizer_linux.cc" ]
314    public_deps += [ "//remoting/host/linux" ]
315    libs += [ "pam" ]
316  }
317
318  if (use_x11 && (!is_chromeos || !use_ozone)) {
319    sources += [
320      "clipboard_x11.cc",
321      "desktop_resizer_x11.cc",
322      "desktop_resizer_x11.h",
323      "input_injector_x11.cc",
324    ]
325    deps += [
326      "//remoting/host/linux:x11",
327      "//ui/events/platform/x11",
328      "//ui/gfx/x",
329    ]
330    if (is_linux) {
331      deps += [ "//build/config/linux/gtk" ]
332    }
333  }
334
335  if (use_ozone && !is_chromeos) {
336    sources += [
337      "desktop_resizer_ozone.cc",
338      "desktop_resizer_ozone.h",
339    ]
340  }
341
342  if (is_linux || is_chromeos) {
343    sources += [
344      "pairing_registry_delegate_linux.cc",
345      "pairing_registry_delegate_linux.h",
346      "resources_linux.cc",
347    ]
348  }
349
350  if (is_linux && !is_chromeos) {
351    sources += [
352      "audio_capturer_linux.cc",
353      "audio_capturer_linux.h",
354      "continue_window_linux.cc",
355      "curtain_mode_linux.cc",
356      "disconnect_window_linux.cc",
357      "keyboard_layout_monitor_linux.cc",
358      "xsession_chooser_linux.cc",
359    ]
360  }
361
362  if (is_chromeos) {
363    sources += [
364      "audio_capturer_chromeos.cc",
365      "continue_window_chromeos.cc",
366      "disconnect_window_chromeos.cc",
367      "input_injector_chromeos.cc",
368      "input_injector_chromeos.h",
369      "keyboard_layout_monitor_chromeos.cc",
370    ]
371    deps += [
372      "//ash",
373      "//remoting/host/chromeos",
374      "//ui/base/ime/chromeos",
375    ]
376
377    if (use_ozone) {
378      deps += [ "//ui/ozone" ]
379    }
380  } else {
381    sources += [
382      "me2me_desktop_environment.cc",
383      "me2me_desktop_environment.h",
384    ]
385  }
386
387  if (is_mac) {
388    sources += [
389      "audio_capturer_mac.cc",
390      "clipboard_mac.mm",
391      "continue_window_mac.mm",
392      "curtain_mode_mac.cc",
393      "desktop_display_info_mac.mm",
394      "desktop_resizer_mac.cc",
395      "disconnect_window_mac.h",
396      "disconnect_window_mac.mm",
397      "input_injector_mac.cc",
398      "keyboard_layout_monitor_mac.cc",
399      "pairing_registry_delegate_mac.cc",
400      "resources_mac.cc",
401      "usage_stats_consent_mac.cc",
402    ]
403    frameworks = [
404      "Accelerate.framework",
405      "Carbon.framework",
406    ]
407
408    deps += [ ":remoting_version" ]
409  }
410
411  if (is_win) {
412    sources += [
413      "audio_capturer_win.cc",
414      "audio_capturer_win.h",
415      "clipboard_win.cc",
416      "continue_window_win.cc",
417      "curtain_mode_win.cc",
418      "daemon_process_win.cc",
419      "desktop_resizer_win.cc",
420      "desktop_session_win.cc",
421      "desktop_session_win.h",
422      "disconnect_window_win.cc",
423      "host_event_logger_win.cc",
424      "input_injector_win.cc",
425      "keyboard_layout_monitor_win.cc",
426      "pairing_registry_delegate_win.cc",
427      "pairing_registry_delegate_win.h",
428      "resources_win.cc",
429      "sas_injector_win.cc",
430      "touch_injector_win.cc",
431      "touch_injector_win.h",
432      "usage_stats_consent_win.cc",
433    ]
434    libs += [ "crypt32.lib" ]
435    deps += [
436      # On Windows, we use //media/gpu/MediaFoundationVideoEncodeAcceleratorWin
437      # to detect whether HW encoder is supported by the system.
438      "//media",
439      "//remoting/host/win",
440      "//remoting/host/win:messages",
441      "//remoting/host/win:remoting_lib_idl",
442    ]
443
444    public_deps += [ "//remoting/host/win" ]
445  }
446}
447
448static_library("test_support") {
449  testonly = true
450
451  sources = [
452    "fake_desktop_environment.cc",
453    "fake_desktop_environment.h",
454    "fake_host_extension.cc",
455    "fake_host_extension.h",
456    "fake_keyboard_layout_monitor.cc",
457    "fake_keyboard_layout_monitor.h",
458    "fake_mouse_cursor_monitor.cc",
459    "fake_mouse_cursor_monitor.h",
460    "host_mock_objects.cc",
461    "host_mock_objects.h",
462  ]
463
464  configs += [ "//remoting/build/config:version" ]
465
466  deps = [
467    "//remoting/proto",
468    "//testing/gmock",
469    "//testing/gtest",
470  ]
471  public_deps = [
472    ":common",
473    "//remoting/base:test_support",
474    "//remoting/host/file_transfer:test_support",
475    "//third_party/libjingle_xmpp",
476    "//third_party/protobuf:protobuf_lite",
477    "//third_party/webrtc_overrides:webrtc_component",
478  ]
479}
480
481# The host portions of the remoting unit tests.
482source_set("unit_tests") {
483  testonly = true
484
485  sources = [
486    "audio_silence_detector_unittest.cc",
487    "audio_volume_filter_unittest.cc",
488    "backoff_timer_unittest.cc",
489    "chromoting_host_context_unittest.cc",
490    "chromoting_host_unittest.cc",
491    "client_session_unittest.cc",
492    "config_file_watcher_unittest.cc",
493    "daemon_process_unittest.cc",
494    "desktop_display_info_unittest.cc",
495    "desktop_process_unittest.cc",
496    "desktop_session_agent_unittest.cc",
497    "ftl_echo_message_listener_unittest.cc",
498    "ftl_host_change_notification_listener_unittest.cc",
499    "ftl_signaling_connector_unittest.cc",
500    "heartbeat_sender_unittest.cc",
501    "host_attributes_unittest.cc",
502    "host_config_unittest.cc",
503    "host_experiment_session_plugin_unittest.cc",
504    "host_extension_session_manager_unittest.cc",
505    "host_power_save_blocker_unittest.cc",
506    "host_status_logger_unittest.cc",
507    "input_monitor/local_input_monitor_unittest.cc",
508    "ipc_desktop_environment_unittest.cc",
509    "it2me/it2me_confirmation_dialog_proxy_unittest.cc",
510    "it2me/it2me_host_unittest.cc",
511    "it2me/it2me_native_messaging_host_unittest.cc",
512    "mouse_cursor_monitor_proxy_unittest.cc",
513    "mouse_shape_pump_unittest.cc",
514    "native_messaging/native_messaging_reader_unittest.cc",
515    "native_messaging/native_messaging_writer_unittest.cc",
516    "pin_hash_unittest.cc",
517    "policy_watcher_unittest.cc",
518    "process_stats_sender_unittest.cc",
519    "remote_input_filter_unittest.cc",
520    "remoting_register_support_host_request_unittest.cc",
521    "resizing_host_observer_unittest.cc",
522    "resources_unittest.cc",
523    "screen_resolution_unittest.cc",
524    "server_log_entry_host_unittest.cc",
525    "setup/me2me_native_messaging_host_unittest.cc",
526    "setup/pin_validator_unittest.cc",
527    "third_party_auth_config_unittest.cc",
528    "token_validator_base_unittest.cc",
529    "token_validator_factory_impl_unittest.cc",
530    "xmpp_register_support_host_request_unittest.cc",
531    "zombie_host_detector_unittest.cc",
532  ]
533
534  if (use_ozone || is_chromeos) {
535    sources -= [ "input_monitor/local_input_monitor_unittest.cc" ]
536  }
537
538  configs += [ "//remoting/build/config:version" ]
539
540  deps = [
541    ":common",
542    ":test_support",
543    "//build:branding_buildflags",
544    "//remoting/host/file_transfer:unit_tests",
545    "//remoting/host/it2me:common",
546    "//remoting/host/native_messaging",
547    "//remoting/host/security_key:unit_tests",
548    "//remoting/host/setup:common",
549    "//remoting/proto",
550    "//remoting/resources",
551    "//skia",
552    "//testing/gmock",
553    "//testing/gtest",
554  ]
555
556  if (is_linux || is_chromeos) {
557    sources += [ "pairing_registry_delegate_linux_unittest.cc" ]
558  }
559
560  if (is_linux && !is_chromeos) {
561    deps += [ "//remoting/host/linux:unit_tests" ]
562  }
563
564  if (is_chromeos) {
565    deps += [
566      "//remoting/host/chromeos:unit_tests",
567      "//remoting/host/linux",  # for AudioPipeReader
568    ]
569  }
570
571  if (is_win) {
572    sources += [
573      "pairing_registry_delegate_win_unittest.cc",
574      "touch_injector_win_unittest.cc",
575    ]
576    deps += [ "//remoting/host/win:unit_tests" ]
577  }
578
579  if (!is_ios) {
580    deps += [ "//components/policy/core/browser:test_support" ]
581  }
582
583  if (enable_me2me_host) {
584    sources += [ "evaluate_capability_unittest.cc" ]
585    data_deps = [ "//remoting/test:capability_test_stub" ]
586  }
587}
588
589group("remoting_host_branded") {
590  testonly = true
591  deps = []
592  if (enable_remoting_host) {
593    deps += [ ":remoting_host_installation" ]
594  }
595  if (enable_me2me_host) {
596    deps += [ "//remoting/host:remoting_me2me_host_archive" ]
597  }
598}
599
600if (enable_remoting_host) {
601  group("remoting_host_installation") {
602    deps = []
603    if (is_win) {
604      deps += [ "//remoting/host/installer/win:remoting_host_installation" ]
605    }
606  }
607}
608
609if (enable_remoting_host) {
610  executable("remoting_start_host") {
611    sources = [ "setup/start_host_entry_point.cc" ]
612
613    deps = [
614      "//third_party/libjingle_xmpp",
615      "//third_party/webrtc_overrides:webrtc_component",
616    ]
617
618    configs += [ "//build/config/compiler:wexit_time_destructors" ]
619
620    if (is_win) {
621      defines = host_predefines +
622                [ "REMOTING_HOST_BINARY=BINARY_REMOTING_START_HOST" ]
623
624      deps += [
625        "//build/win:default_exe_manifest",
626        "//remoting/host/win:remoting_core",
627        "//remoting/host/win:remoting_windows_resources",
628      ]
629    } else {
630      sources += [
631        "setup/host_starter.cc",
632        "setup/host_starter.h",
633        "setup/host_stopper.cc",
634        "setup/host_stopper.h",
635        "setup/start_host_main.cc",
636        "setup/start_host_main.h",
637      ]
638
639      deps += [
640        "//google_apis",
641        "//mojo/core/embedder",
642        "//net",
643        "//remoting/host/setup",
644      ]
645    }
646  }
647
648  # TODO(crbug.com/1112471): Get this to run cleanly under Python 3.
649  python2_action_foreach("remoting_native_messaging_manifests") {
650    if (is_mac) {
651      me2me_host_path = "/Library/PrivilegedHelperTools/$me2me_host_bundle_name/Contents/MacOS/$native_messaging_host_bundle_name/Contents/MacOS/native_messaging_host"
652      it2me_host_path = "/Library/PrivilegedHelperTools/$me2me_host_bundle_name/Contents/MacOS/$remote_assistance_host_bundle_name/Contents/MacOS/remote_assistance_host"
653    } else if (is_win) {
654      me2me_host_path = "remoting_native_messaging_host.exe"
655      it2me_host_path = "remote_assistance_host.exe"
656    } else {
657      me2me_host_path =
658          "/opt/google/chrome-remote-desktop/native-messaging-host"
659      it2me_host_path =
660          "/opt/google/chrome-remote-desktop/remote-assistance-host"
661    }
662
663    script = "../tools/build/remoting_localize.py"
664
665    sources = [
666      "it2me/com.google.chrome.remote_assistance-firefox.json.jinja2",
667      "it2me/com.google.chrome.remote_assistance.json.jinja2",
668      "setup/com.google.chrome.remote_desktop-firefox.json.jinja2",
669      "setup/com.google.chrome.remote_desktop.json.jinja2",
670    ]
671
672    inputs = [ branding_path ]
673
674    outputs = [ "$root_build_dir/remoting/{{source_name_part}}" ]
675
676    args = [
677      "--define",
678      "ME2ME_HOST_PATH=$me2me_host_path",
679      "--define",
680      "IT2ME_HOST_PATH=$it2me_host_path",
681      "--variables",
682      rebase_path(branding_path, root_build_dir),
683      "--template",
684      "{{source}}",
685      "--output",
686      "remoting/{{source_name_part}}",
687      "en",
688    ]
689  }
690
691  # TODO(crbug.com/1112471): Get this to run cleanly under Python 3.
692  python2_action_foreach("remoting_infoplist_strings") {
693    sources = [
694      "it2me/remote_assistance_host-InfoPlist.strings.jinja2",
695      "remoting_me2me_host-InfoPlist.strings.jinja2",
696      "setup/native_messaging_host-InfoPlist.strings.jinja2",
697    ]
698
699    if (is_mac) {
700      sources += [ "installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2" ]
701    }
702
703    script = "//remoting/tools/build/remoting_localize.py"
704    args = [
705             "--locale_dir",
706             rebase_path(resources_locale_dir, root_build_dir),
707             "--variables",
708             rebase_path(branding_path, root_build_dir),
709             "--template",
710             "{{source}}",
711             "--locale_output",
712             rebase_path(
713                 "$root_gen_dir/remoting/host/{{source_name_part}}/@{json_suffix}.lproj/InfoPlist.strings",
714                 root_build_dir),
715           ] + remoting_locales_with_underscores
716
717    outputs = []
718    foreach(locale, remoting_locales_with_underscores) {
719      outputs += [ "$root_gen_dir/remoting/host/{{source_name_part}}/$locale.lproj/InfoPlist.strings" ]
720    }
721
722    deps = [
723      "//remoting/resources",
724      "//remoting/resources:strings",
725    ]
726  }
727}
728
729if (enable_me2me_host) {
730  static_library("remoting_me2me_host_static") {
731    sources = [ "remoting_me2me_host.cc" ]
732    defines = []
733
734    configs += [
735      "//remoting/build/config:version",
736      "//remoting/build/config:remoting_me2me_host",
737    ]
738
739    deps = [
740      "//base",
741      "//base:i18n",
742      "//components/policy/core/common",
743      "//ipc",
744      "//mojo/core/embedder",
745      "//net",
746      "//remoting/base",
747      "//remoting/host",
748      "//remoting/proto",
749      "//third_party/libjingle_xmpp",
750      "//third_party/webrtc_overrides:webrtc_component",
751    ]
752
753    if (is_posix) {
754      sources += [
755        "pam_authorization_factory_posix.cc",
756        "pam_authorization_factory_posix.h",
757      ]
758    }
759
760    if (!is_ios) {
761      deps += [ "//components/policy:generated" ]
762    }
763
764    if (is_linux) {
765      deps += [ "//build/config/linux/gtk" ]
766    }
767    if ((is_linux && !is_chromeos) || is_mac) {
768      libs = [ "pam" ]
769    }
770
771    if (is_mac && is_official_build) {
772      sources += [ "internal/internal_mac-inl.h" ]
773    }
774  }
775
776  if (is_win) {
777    group("remoting_me2me_host") {
778      deps = [ "//remoting/host/win:remoting_me2me_host" ]
779    }
780    group("remoting_native_messaging_host") {
781      deps = [ "//remoting/host/win:remoting_native_messaging_host" ]
782    }
783  } else {
784    source_set("main") {
785      sources = [
786        "host_main.cc",
787        "host_main.h",
788      ]
789      deps = [
790        "//base",
791        "//base:debugging_buildflags",
792      ]
793    }
794    if (is_mac) {
795      group("remoting_me2me_host") {
796        deps = [ "//remoting/host/mac:remoting_me2me_host" ]
797      }
798    } else {
799      target("executable", "remoting_me2me_host") {
800        configs += [ "//remoting/build/config:version" ]
801
802        sources = [
803          "host_main.cc",
804          "host_main.h",
805        ]
806
807        deps = [
808          ":remoting_me2me_host_static",
809          "//base",
810          "//remoting/base:breakpad",
811          "//remoting/host/installer:credits",
812          "//remoting/resources",
813        ]
814      }
815    }
816
817    if (is_mac) {
818      group("remoting_native_messaging_host") {
819        deps = [ "//remoting/host/mac:remoting_native_messaging_host" ]
820      }
821    } else {
822      group("remoting_native_messaging_host") {
823        deps = [ "//remoting/host/linux:remoting_native_messaging_host" ]
824      }
825    }
826  }
827  if (is_chrome_branded && enable_me2me_host && is_linux && !is_chromeos) {
828    group("remoting_me2me_host_archive") {
829      deps = [ "//remoting/host/installer/linux:remoting_me2me_host_archive" ]
830    }
831  } else if (is_win) {
832    group("remoting_me2me_host_archive") {
833      deps = [ "//remoting/host/installer/win:remoting_me2me_host_archive" ]
834    }
835  } else if (is_mac) {
836    group("remoting_me2me_host_archive") {
837      deps = [ "//remoting/host/installer/mac:remoting_me2me_host_archive" ]
838    }
839  } else {
840    group("remoting_me2me_host_archive") {
841    }
842  }
843}
844