Allow overlapping sync and async startup requests
[chromium-blink-merge.git] / remoting / remoting.gyp
blobec6d74770d5aca298dd87314d99840c52d59c5a5
1 # Copyright (c) 2012 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.
6   'variables': {
7     'chromium_code': 1,
9     'variables': {
10       'conditions': [
11         # Enable the multi-process host on Windows by default.
12         ['OS=="win"', {
13           'remoting_multi_process%': 1,
14         }, {
15           'remoting_multi_process%': 0,
16         }],
17       ],
18     },
20     'remoting_multi_process%': '<(remoting_multi_process)',
21     'remoting_rdp_session%': 1,
23     'remoting_localize_path': 'tools/build/remoting_localize.py',
25     # The |major|, |build| and |patch| versions are inherited from Chrome.
26     # Since Chrome's |minor| version is always '0', we replace it with a
27     # Chromoting-specific patch version.
28     # Note that we check both the |chrome_version_path| file and the
29     # |remoting_version_path| so that we can override the Chrome version
30     # numbers if needed.
31     'version_py_path': '../chrome/tools/build/version.py',
32     'remoting_version_path': '../remoting/VERSION',
33     'chrome_version_path': '../chrome/VERSION',
34     'version_major':
35       '<!(python <(version_py_path) -f <(chrome_version_path) -f <(remoting_version_path) -t "@MAJOR@")',
36     'version_minor':
37       '<!(python <(version_py_path) -f <(remoting_version_path) -t "@REMOTING_PATCH@")',
38     'version_short':
39       '<(version_major).<(version_minor).'
40       '<!(python <(version_py_path) -f <(chrome_version_path) -f <(remoting_version_path) -t "@BUILD@")',
41     'version_full':
42       '<(version_short).'
43       '<!(python <(version_py_path) -f <(chrome_version_path) -f <(remoting_version_path) -t "@PATCH@")',
45     'branding_path': '../remoting/branding_<(branding)',
47     'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
49     'host_plugin_mime_type': 'application/vnd.chromium.remoting-host',
51     'conditions': [
52       # Remoting host is supported only on Windows, OSX and Linux (with X11).
53       ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0 and use_x11==1)', {
54         'enable_remoting_host': 1,
55       }, {
56         'enable_remoting_host': 0,
57       }],
58       ['OS=="mac"', {
59         'mac_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_BUNDLE_ID@")',
60         'mac_creator': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_CREATOR@")',
61         'host_plugin_extension': 'plugin',
62         'host_plugin_prefix': '',
63       }],
64       ['os_posix == 1 and OS != "mac" and target_arch == "ia32"', {
65         # linux 32 bit
66         'host_plugin_extension': 'ia32.so',
67         'host_plugin_prefix': 'lib',
68       }],
69       ['os_posix == 1 and OS != "mac" and target_arch == "x64"', {
70         # linux 64 bit
71         'host_plugin_extension': 'x64.so',
72         'host_plugin_prefix': 'lib',
73       }],
74       ['os_posix == 1 and OS != "mac" and target_arch == "arm"', {
75         'host_plugin_extension': 'arm.so',
76         'host_plugin_prefix': 'lib',
77       }],
78       ['os_posix == 1 and OS != "mac" and target_arch == "mipsel"', {
79         'host_plugin_extension': 'mipsel.so',
80         'host_plugin_prefix': 'lib',
81       }],
82       ['OS=="win"', {
83         'host_plugin_extension': 'dll',
84         'host_plugin_prefix': '',
85         # Use auto-generated CLSIDs to make sure that the newly installed COM
86         # classes will be used during/after upgrade even if there are old
87         # instances running already.
88         # The parameter at the end is ignored, but needed to make sure that the
89         # script will be invoked separately for each CLSID. Otherwise GYP will
90         # reuse the value returned by the first invocation of the script.
91         'daemon_controller_clsid':
92             '<!(python -c "import uuid; print uuid.uuid4()" 1)',
93         'rdp_desktop_session_clsid':
94             '<!(python -c "import uuid; print uuid.uuid4()" 2)',
95       }],
96     ],
98     'remoting_locales': [
99       'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es',
100       'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id',
101       'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT',
102       'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi',
103       'zh-CN', 'zh-TW',
104     ],
105     'remoting_locale_files': [
106       # Build the list of .pak files generated from remoting_strings.grd.
107       '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x '
108           '<(PRODUCT_DIR) <(remoting_locales))',
109     ],
110     'remoting_webapp_locale_files': [
111       # Build the list of .json files generated from remoting_strings.grd.
112       '<!@pymod_do_main(remoting_localize --locale_output '
113           '"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
114           '--print_only <(remoting_locales))',
115     ],
116     'remoting_webapp_files': [
117       'resources/chromoting16.webp',
118       'resources/chromoting48.webp',
119       'resources/chromoting128.webp',
120       'resources/disclosure_arrow_down.webp',
121       'resources/disclosure_arrow_right.webp',
122       'resources/host_setup_instructions.webp',
123       'resources/icon_cross.webp',
124       'resources/icon_host.webp',
125       'resources/icon_pencil.webp',
126       'resources/icon_warning.webp',
127       'resources/infographic_my_computers.webp',
128       'resources/infographic_remote_assistance.webp',
129       'resources/tick.webp',
130       'webapp/connection_history.css',
131       'webapp/connection_stats.css',
132       'webapp/main.css',
133       'webapp/main.html',
134       'webapp/manifest.json',
135       'webapp/menu_button.css',
136       'webapp/oauth2_callback.html',
137       'webapp/open_sans.css',
138       'webapp/open_sans.woff',
139       'webapp/scale-to-fit.webp',
140       'webapp/spinner.gif',
141       'webapp/toolbar.css',
142       'webapp/wcs_sandbox.html',
143     ],
144     'remoting_webapp_js_files': [
145       'webapp/butter_bar.js',
146       'webapp/client_plugin.js',
147       'webapp/client_plugin_async.js',
148       'webapp/client_screen.js',
149       'webapp/client_session.js',
150       'webapp/clipboard.js',
151       'webapp/connection_history.js',
152       'webapp/connection_stats.js',
153       'webapp/cs_oauth2_trampoline.js',
154       'webapp/cs_third_party_auth_trampoline.js',
155       'webapp/error.js',
156       'webapp/event_handlers.js',
157       'webapp/format_iq.js',
158       'webapp/host.js',
159       'webapp/host_controller.js',
160       'webapp/host_dispatcher.js',
161       'webapp/host_list.js',
162       'webapp/host_native_messaging.js',
163       'webapp/host_screen.js',
164       'webapp/host_session.js',
165       'webapp/host_settings.js',
166       'webapp/host_setup_dialog.js',
167       'webapp/host_table_entry.js',
168       'webapp/identity.js',
169       'webapp/l10n.js',
170       'webapp/log_to_server.js',
171       'webapp/menu_button.js',
172       'webapp/oauth2.js',
173       'webapp/oauth2_api.js',
174       'webapp/oauth2_callback.js',
175       'webapp/paired_client_manager.js',
176       'webapp/plugin_settings.js',
177       'webapp/remoting.js',
178       'webapp/server_log_entry.js',
179       'webapp/session_connector.js',
180       'webapp/stats_accumulator.js',
181       'webapp/third_party_host_permissions.js',
182       'webapp/xhr_proxy.js',
183       'webapp/third_party_token_fetcher.js',
184       'webapp/toolbar.js',
185       'webapp/ui_mode.js',
186       'webapp/wcs.js',
187       'webapp/wcs_loader.js',
188       'webapp/wcs_sandbox_container.js',
189       'webapp/wcs_sandbox_content.js',
190       'webapp/xhr.js',
191     ],
192     'remoting_host_installer_mac_roots': [
193       'host/installer/mac/',
194       '<(DEPTH)/chrome/installer/mac/',
195     ],
196     'remoting_host_installer_mac_files': [
197       'host/installer/mac/do_signing.sh',
198       'host/installer/mac/do_signing.props',
199       'host/installer/mac/ChromotingHost.pkgproj',
200       'host/installer/mac/ChromotingHostService.pkgproj',
201       'host/installer/mac/ChromotingHostUninstaller.pkgproj',
202       'host/installer/mac/LaunchAgents/org.chromium.chromoting.plist',
203       'host/installer/mac/PrivilegedHelperTools/org.chromium.chromoting.me2me.sh',
204       'host/installer/mac/Config/org.chromium.chromoting.conf',
205       'host/installer/mac/Scripts/keystone_install.sh',
206       'host/installer/mac/Scripts/remoting_postflight.sh',
207       'host/installer/mac/Scripts/remoting_preflight.sh',
208       'host/installer/mac/Keystone/GoogleSoftwareUpdate.pkg',
209       '<(DEPTH)/chrome/installer/mac/pkg-dmg',
210     ],
211     'remoting_host_installer_win_roots': [
212       'host/installer/win/',
213     ],
214     'remoting_host_installer_win_files': [
215       'host/installer/win/chromoting.wxs',
216       'host/installer/win/parameters.json',
217     ],
218   },
220   'includes': [
221     '../chrome/js_unittest_vars.gypi',
222   ],
224   'target_defaults': {
225     'defines': [
226       'BINARY_CORE=1',
227       'BINARY_DESKTOP=2',
228       'BINARY_HOST_ME2ME=3',
229       'BINARY_HOST_PLUGIN=4',
230     ],
231     'include_dirs': [
232       '..',  # Root of Chrome checkout
233     ],
234     'variables': {
235       'win_debug_RuntimeChecks': '0',
236     },
237     'conditions': [
238       ['OS=="mac" and mac_breakpad==1', {
239         'defines': [
240           'REMOTING_ENABLE_BREAKPAD'
241         ],
242       }],
243       ['OS=="win" and buildtype == "Official"', {
244         'defines': [
245           'REMOTING_ENABLE_BREAKPAD'
246         ],
247       }],
248       ['OS=="win" and remoting_multi_process != 0 and \
249           remoting_rdp_session != 0', {
250         'defines': [
251           'REMOTING_RDP_SESSION',
252         ],
253       }],
254       ['remoting_multi_process != 0', {
255         'defines': [
256           'REMOTING_MULTI_PROCESS',
257         ],
258       }],
259     ],
260   },
262   'conditions': [
263     ['enable_remoting_host==1', {
264       'targets': [
265         {
266           'target_name': 'remoting_host',
267           'type': 'static_library',
268           'variables': { 'enable_wexit_time_destructors': 1, },
269           'dependencies': [
270             'remoting_base',
271             'remoting_jingle_glue',
272             'remoting_protocol',
273             'remoting_resources',
274             '../crypto/crypto.gyp:crypto',
275             '../google_apis/google_apis.gyp:google_apis',
276             '../ipc/ipc.gyp:ipc',
277             '../third_party/webrtc/modules/modules.gyp:desktop_capture',
278           ],
279           'defines': [
280             'VERSION=<(version_full)',
281           ],
282           'sources': [
283             'host/audio_capturer.cc',
284             'host/audio_capturer.h',
285             'host/audio_capturer_linux.cc',
286             'host/audio_capturer_linux.h',
287             'host/audio_capturer_mac.cc',
288             'host/audio_capturer_win.cc',
289             'host/audio_capturer_win.h',
290             'host/audio_scheduler.cc',
291             'host/audio_scheduler.h',
292             'host/audio_silence_detector.cc',
293             'host/audio_silence_detector.h',
294             'host/basic_desktop_environment.cc',
295             'host/basic_desktop_environment.h',
296             'host/capture_scheduler.cc',
297             'host/capture_scheduler.h',
298             'host/chromoting_host.cc',
299             'host/chromoting_host.h',
300             'host/chromoting_host_context.cc',
301             'host/chromoting_host_context.h',
302             'host/chromoting_messages.cc',
303             'host/chromoting_messages.h',
304             'host/chromoting_param_traits.cc',
305             'host/chromoting_param_traits.h',
306             'host/client_session.cc',
307             'host/client_session.h',
308             'host/client_session_control.h',
309             'host/clipboard.h',
310             'host/clipboard_mac.mm',
311             'host/clipboard_win.cc',
312             'host/clipboard_x11.cc',
313             'host/config_file_watcher.cc',
314             'host/config_file_watcher.h',
315             'host/constants_mac.cc',
316             'host/constants_mac.h',
317             'host/continue_window.cc',
318             'host/continue_window.h',
319             'host/continue_window_aura.cc',
320             'host/continue_window_gtk.cc',
321             'host/continue_window_mac.mm',
322             'host/continue_window_win.cc',
323             'host/desktop_environment.h',
324             'host/desktop_resizer.h',
325             'host/desktop_resizer_linux.cc',
326             'host/desktop_resizer_mac.cc',
327             'host/desktop_resizer_win.cc',
328             'host/desktop_session_connector.h',
329             'host/desktop_session_proxy.cc',
330             'host/desktop_session_proxy.h',
331             'host/disconnect_window_aura.cc',
332             'host/disconnect_window_gtk.cc',
333             'host/disconnect_window_mac.h',
334             'host/disconnect_window_mac.mm',
335             'host/disconnect_window_win.cc',
336             'host/dns_blackhole_checker.cc',
337             'host/dns_blackhole_checker.h',
338             'host/heartbeat_sender.cc',
339             'host/heartbeat_sender.h',
340             'host/host_status_sender.cc',
341             'host/host_status_sender.h',
342             'host/host_change_notification_listener.cc',
343             'host/host_change_notification_listener.h',
344             'host/host_config.cc',
345             'host/host_config.h',
346             'host/host_exit_codes.h',
347             'host/host_exit_codes.cc',
348             'host/host_secret.cc',
349             'host/host_secret.h',
350             'host/host_status_monitor.h',
351             'host/host_status_observer.h',
352             'host/host_window.h',
353             'host/host_window_proxy.cc',
354             'host/host_window_proxy.h',
355             'host/in_memory_host_config.cc',
356             'host/in_memory_host_config.h',
357             'host/input_injector.h',
358             'host/input_injector_linux.cc',
359             'host/input_injector_mac.cc',
360             'host/input_injector_win.cc',
361             'host/ipc_audio_capturer.cc',
362             'host/ipc_audio_capturer.h',
363             'host/ipc_constants.cc',
364             'host/ipc_constants.h',
365             'host/ipc_desktop_environment.cc',
366             'host/ipc_desktop_environment.h',
367             'host/ipc_host_event_logger.cc',
368             'host/ipc_host_event_logger.h',
369             'host/ipc_input_injector.cc',
370             'host/ipc_input_injector.h',
371             'host/ipc_screen_controls.cc',
372             'host/ipc_screen_controls.h',
373             'host/ipc_util.h',
374             'host/ipc_util_posix.cc',
375             'host/ipc_util_win.cc',
376             'host/ipc_video_frame_capturer.cc',
377             'host/ipc_video_frame_capturer.h',
378             'host/it2me_desktop_environment.cc',
379             'host/it2me_desktop_environment.h',
380             'host/json_host_config.cc',
381             'host/json_host_config.h',
382             'host/linux/audio_pipe_reader.cc',
383             'host/linux/audio_pipe_reader.h',
384             'host/linux/x11_util.cc',
385             'host/linux/x11_util.h',
386             'host/linux/x_server_clipboard.cc',
387             'host/linux/x_server_clipboard.h',
388             'host/local_input_monitor.h',
389             'host/local_input_monitor_linux.cc',
390             'host/local_input_monitor_mac.mm',
391             'host/local_input_monitor_win.cc',
392             'host/log_to_server.cc',
393             'host/log_to_server.h',
394             'host/me2me_desktop_environment.cc',
395             'host/me2me_desktop_environment.h',
396             'host/mouse_clamping_filter.cc',
397             'host/mouse_clamping_filter.h',
398             'host/pairing_registry_delegate.cc',
399             'host/pairing_registry_delegate.h',
400             'host/pairing_registry_delegate_linux.cc',
401             'host/pairing_registry_delegate_linux.h',
402             'host/pairing_registry_delegate_mac.cc',
403             'host/pairing_registry_delegate_win.cc',
404             'host/pairing_registry_delegate_win.h',
405             'host/pam_authorization_factory_posix.cc',
406             'host/pam_authorization_factory_posix.h',
407             'host/pin_hash.cc',
408             'host/pin_hash.h',
409             'host/policy_hack/policy_watcher.cc',
410             'host/policy_hack/policy_watcher.h',
411             'host/policy_hack/policy_watcher_linux.cc',
412             'host/policy_hack/policy_watcher_mac.mm',
413             'host/policy_hack/policy_watcher_win.cc',
414             'host/register_support_host_request.cc',
415             'host/register_support_host_request.h',
416             'host/remote_input_filter.cc',
417             'host/remote_input_filter.h',
418             'host/resizing_host_observer.cc',
419             'host/resizing_host_observer.h',
420             'host/sas_injector.h',
421             'host/sas_injector_win.cc',
422             'host/screen_controls.h',
423             'host/screen_resolution.cc',
424             'host/screen_resolution.h',
425             'host/server_log_entry.cc',
426             'host/server_log_entry.h',
427             'host/service_urls.cc',
428             'host/service_urls.h',
429             'host/session_manager_factory.cc',
430             'host/session_manager_factory.h',
431             'host/signaling_connector.cc',
432             'host/signaling_connector.h',
433             'host/token_validator_factory_impl.cc',
434             'host/token_validator_factory_impl.h',
435             'host/usage_stats_consent.h',
436             'host/usage_stats_consent_mac.cc',
437             'host/usage_stats_consent_win.cc',
438             'host/video_scheduler.cc',
439             'host/video_scheduler.h',
440             'host/win/com_security.cc',
441             'host/win/com_security.h',
442             'host/win/launch_process_with_token.cc',
443             'host/win/launch_process_with_token.h',
444             'host/win/omaha.cc',
445             'host/win/omaha.h',
446             'host/win/rdp_client.cc',
447             'host/win/rdp_client.h',
448             'host/win/rdp_client_window.cc',
449             'host/win/rdp_client_window.h',
450             'host/win/security_descriptor.cc',
451             'host/win/security_descriptor.h',
452             'host/win/session_desktop_environment.cc',
453             'host/win/session_desktop_environment.h',
454             'host/win/session_input_injector.cc',
455             'host/win/session_input_injector.h',
456             'host/win/window_station_and_desktop.cc',
457             'host/win/window_station_and_desktop.h',
458             'host/win/wts_terminal_monitor.cc',
459             'host/win/wts_terminal_monitor.h',
460             'host/win/wts_terminal_observer.h',
461           ],
462           'conditions': [
463             ['OS=="linux"', {
464               'dependencies': [
465                 # Always use GTK on Linux, even for Aura builds.
466                 #
467                 # TODO(lambroslambrou): Once the DisconnectWindow and
468                 # ContinueWindow classes have been implemented for Aura,
469                 # remove this dependency.
470                 '../build/linux/system.gyp:gtk',
471               ],
472               'link_settings': {
473                 'libraries': [
474                   '-lX11',
475                   '-lXext',
476                   '-lXfixes',
477                   '-lXtst',
478                   '-lXi',
479                   '-lXrandr',
480                   '-lpam',
481                 ],
482               },
483             }, {  # else OS != "linux"
484               'sources!': [
485                 'host/continue_window_aura.cc',
486                 'host/disconnect_window_aura.cc',
487               ],
488             }],
489             ['OS=="mac"', {
490               'sources': [
491                 '../third_party/GTM/AppKit/GTMCarbonEvent.h',
492                 '../third_party/GTM/AppKit/GTMCarbonEvent.m',
493                 '../third_party/GTM/DebugUtils/GTMDebugSelectorValidation.h',
494                 '../third_party/GTM/DebugUtils/GTMTypeCasting.h',
495                 '../third_party/GTM/Foundation/GTMObjectSingleton.h',
496                 '../third_party/GTM/GTMDefines.h',
497               ],
498               'include_dirs': [
499                 '../third_party/GTM',
500                 '../third_party/GTM/AppKit',
501                 '../third_party/GTM/DebugUtils',
502                 '../third_party/GTM/Foundation',
503               ],
504               'link_settings': {
505                 'libraries': [
506                   '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
507                   'libpam.a',
508                ],
509               },
510             }],
511             ['OS=="win"', {
512               'defines': [
513                 '_ATL_NO_EXCEPTIONS',
514                 'ISOLATION_AWARE_ENABLED=1',
515               ],
516               'dependencies': [
517                 '../sandbox/sandbox.gyp:sandbox',
518               ],
519               'msvs_settings': {
520                 'VCCLCompilerTool': {
521                   # /MP conflicts with #import directive so we limit the number
522                   # of processes to spawn to 1.
523                   'AdditionalOptions': ['/MP1'],
524                 },
525               },
526             }],
527           ],
528         },  # end of target 'remoting_host'
530         {
531           'target_name': 'remoting_me2me_host_static',
532           'type': 'static_library',
533           'variables': { 'enable_wexit_time_destructors': 1, },
534           'dependencies': [
535             '../base/base.gyp:base',
536             '../base/base.gyp:base_i18n',
537             '../net/net.gyp:net',
538             '../third_party/webrtc/modules/modules.gyp:desktop_capture',
539             'remoting_base',
540             'remoting_breakpad',
541             'remoting_host',
542             'remoting_host_event_logger',
543             'remoting_host_logging',
544             'remoting_jingle_glue',
545           ],
546           'defines': [
547             'VERSION=<(version_full)',
548           ],
549           'sources': [
550             'host/curtain_mode.h',
551             'host/curtain_mode_linux.cc',
552             'host/curtain_mode_mac.cc',
553             'host/curtain_mode_win.cc',
554             'host/posix/signal_handler.cc',
555             'host/posix/signal_handler.h',
556           ],
557           'conditions': [
558             ['os_posix != 1', {
559               'sources/': [
560                 ['exclude', '^host/posix/'],
561               ],
562             }],
563           ],  # end of 'conditions'
564         },  # end of target 'remoting_me2me_host_static'
566         {
567           'target_name': 'remoting_host_setup_base',
568           'type': 'static_library',
569           'variables': { 'enable_wexit_time_destructors': 1, },
570           'dependencies': [
571             '../base/base.gyp:base',
572             '../google_apis/google_apis.gyp:google_apis',
573             'remoting_host',
574           ],
575           'defines': [
576             'VERSION=<(version_full)',
577           ],
578           'sources': [
579             'host/setup/daemon_controller.h',
580             'host/setup/daemon_controller_linux.cc',
581             'host/setup/daemon_controller_mac.mm',
582             'host/setup/daemon_controller_win.cc',
583             'host/setup/daemon_installer_win.cc',
584             'host/setup/daemon_installer_win.h',
585             'host/setup/host_starter.cc',
586             'host/setup/host_starter.h',
587             'host/setup/native_messaging_host.cc',
588             'host/setup/native_messaging_host.h',
589             'host/setup/native_messaging_reader.cc',
590             'host/setup/native_messaging_reader.h',
591             'host/setup/native_messaging_writer.cc',
592             'host/setup/native_messaging_writer.h',
593             'host/setup/oauth_client.cc',
594             'host/setup/oauth_client.h',
595             'host/setup/oauth_helper.cc',
596             'host/setup/oauth_helper.h',
597             'host/setup/pin_validator.cc',
598             'host/setup/pin_validator.h',
599             'host/setup/service_client.cc',
600             'host/setup/service_client.h',
601             'host/setup/test_util.cc',
602             'host/setup/test_util.h',
603             'host/setup/win/auth_code_getter.cc',
604             'host/setup/win/auth_code_getter.h',
605           ],
606           'conditions': [
607             ['OS=="win"', {
608               'dependencies': [
609                 '../google_update/google_update.gyp:google_update',
610                 'remoting_lib_idl',
611               ],
612               # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
613               'msvs_disabled_warnings': [4267, ],
614             }],
615           ],
616         },  # end of target 'remoting_host_setup_base'
618         {
619           'target_name': 'remoting_host_plugin',
620           'type': 'loadable_module',
621           'variables': { 'enable_wexit_time_destructors': 1, },
622           'product_extension': '<(host_plugin_extension)',
623           'product_prefix': '<(host_plugin_prefix)',
624           'defines': [
625             'HOST_PLUGIN_MIME_TYPE=<(host_plugin_mime_type)',
626           ],
627           'dependencies': [
628             '../base/base.gyp:base_i18n',
629             '../net/net.gyp:net',
630             '../third_party/npapi/npapi.gyp:npapi',
631             'remoting_base',
632             'remoting_host',
633             'remoting_host_event_logger',
634             'remoting_host_logging',
635             'remoting_infoplist_strings',
636             'remoting_host_setup_base',
637             'remoting_jingle_glue',
638             'remoting_resources',
639           ],
640           'sources': [
641             'base/dispatch_win.h',
642             'host/plugin/host_log_handler.cc',
643             'host/plugin/host_log_handler.h',
644             'host/plugin/host_plugin.cc',
645             'host/plugin/host_plugin_utils.cc',
646             'host/plugin/host_plugin_utils.h',
647             'host/plugin/host_script_object.cc',
648             'host/plugin/host_script_object.h',
649             'host/win/core_resource.h',
650           ],
651           'conditions': [
652             ['OS=="mac"', {
653               'mac_bundle': 1,
654               'xcode_settings': {
655                 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
656                 'INFOPLIST_FILE': 'host/plugin/host_plugin-Info.plist',
657                 'INFOPLIST_PREPROCESS': 'YES',
658                 # TODO(maruel): Use INFOPLIST_PREFIX_HEADER to remove the need to
659                 # duplicate string once
660                 # http://code.google.com/p/gyp/issues/detail?id=243 is fixed.
661                 'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'HOST_PLUGIN_MIME_TYPE="<(host_plugin_mime_type)" VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)"',
662               },
663               # TODO(mark): Come up with a fancier way to do this.  It should
664               # only be necessary to list host_plugin-Info.plist once, not the
665               # three times it is listed here.
666               'mac_bundle_resources': [
667                 'host/disconnect_window.xib',
668                 'host/plugin/host_plugin-Info.plist',
669                 'resources/chromoting16.png',
670                 'resources/chromoting48.png',
671                 'resources/chromoting128.png',
672                 '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x <(PRODUCT_DIR) <(remoting_locales))',
674                 # Localized strings for 'Info.plist'
675                 '<!@pymod_do_main(remoting_localize --locale_output '
676                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/host_plugin_resources/@{json_suffix}.lproj/InfoPlist.strings" '
677                     '--print_only <(remoting_locales))',
678               ],
679               'mac_bundle_resources!': [
680                 'host/plugin/host_plugin-Info.plist',
681               ],
682               'conditions': [
683                 ['mac_breakpad==1', {
684                   'variables': {
685                     # A real .dSYM is needed for dump_syms to operate on.
686                     'mac_real_dsym': 1,
687                   },
688                 }],
689               ],  # conditions
690             }],  # OS=="mac"
691             [ 'OS=="win"', {
692               'defines': [
693                 'BINARY=BINARY_HOST_PLUGIN',
694                 'ISOLATION_AWARE_ENABLED=1',
695               ],
696               'dependencies': [
697                 'remoting_lib_idl',
698                 'remoting_core_resources',
699                 'remoting_version_resources',
700               ],
701               'include_dirs': [
702                 '<(INTERMEDIATE_DIR)',
703               ],
704               'sources': [
705                 '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc',
706                 '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
707                 'host/plugin/host_plugin.def',
708               ],
709               'msvs_settings': {
710                 'VCManifestTool': {
711                   'EmbedManifest': 'true',
712                 },
713                 'VCLinkerTool': {
714                   'AdditionalOptions': [
715                     "\"/manifestdependency:type='win32' "
716                         "name='Microsoft.Windows.Common-Controls' "
717                         "version='6.0.0.0' "
718                         "processorArchitecture='*' "
719                         "publicKeyToken='6595b64144ccf1df' language='*'\"",
720                   ],
721                 },
722               },
723             }],
724           ],
725         },  # end of target 'remoting_host_plugin'
726         {
727           'target_name': 'remoting_infoplist_strings',
728           'type': 'none',
729           'dependencies': [
730             'remoting_resources',
731           ],
732           'actions': [
733             {
734               'action_name': 'generate_host_plugin_strings',
735               'inputs': [
736                 '<(remoting_localize_path)',
737                 'host/plugin/host_plugin-InfoPlist.strings.jinja2',
738               ],
739               'outputs': [
740                 '<!@pymod_do_main(remoting_localize --locale_output '
741                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/host_plugin_resources/@{json_suffix}.lproj/InfoPlist.strings" '
742                     '--print_only <(remoting_locales))',
743               ],
744               'action': [
745                 'python',
746                 '<(remoting_localize_path)',
747                 '--locale_dir', '<(webapp_locale_dir)',
748                 '--template', 'host/plugin/host_plugin-InfoPlist.strings.jinja2',
749                 '--locale_output',
750                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host_plugin_resources/@{json_suffix}.lproj/InfoPlist.strings',
751                 '--encoding', 'utf-8',
752                 '<@(remoting_locales)',
753               ],
754             },
755             {
756               'action_name': 'generate_host_strings',
757               'inputs': [
758                 '<(remoting_localize_path)',
759                 'host/remoting_me2me_host-InfoPlist.strings.jinja2',
760               ],
761               'outputs': [
762                 '<!@pymod_do_main(remoting_localize --locale_output '
763                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/host_resources/@{json_suffix}.lproj/InfoPlist.strings" '
764                     '--print_only <(remoting_locales))',
765               ],
766               'action': [
767                 'python',
768                 '<(remoting_localize_path)',
769                 '--locale_dir', '<(webapp_locale_dir)',
770                 '--template', 'host/remoting_me2me_host-InfoPlist.strings.jinja2',
771                 '--locale_output',
772                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host_resources/@{json_suffix}.lproj/InfoPlist.strings',
773                 '--encoding', 'utf-8',
774                 '<@(remoting_locales)',
775               ],
776             },
777             {
778               'action_name': 'generate_preference_pane_strings',
779               'inputs': [
780                 '<(remoting_localize_path)',
781                 'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2',
782               ],
783               'outputs': [
784                 '<!@pymod_do_main(remoting_localize --locale_output '
785                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/preference_pane_resources/@{json_suffix}.lproj/InfoPlist.strings" '
786                     '--print_only <(remoting_locales))',
787               ],
788               'action': [
789                 'python',
790                 '<(remoting_localize_path)',
791                 '--locale_dir', '<(webapp_locale_dir)',
792                 '--template', 'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2',
793                 '--locale_output',
794                 '<(SHARED_INTERMEDIATE_DIR)/remoting/preference_pane_resources/@{json_suffix}.lproj/InfoPlist.strings',
795                 '--encoding', 'utf-8',
796                 '<@(remoting_locales)',
797               ],
798             },
799             {
800               'action_name': 'generate_uninstaller_strings',
801               'inputs': [
802                 '<(remoting_localize_path)',
803                 'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2',
804               ],
805               'outputs': [
806                 '<!@pymod_do_main(remoting_localize --locale_output '
807                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/uninstaller_resources/@{json_suffix}.lproj/InfoPlist.strings" '
808                     '--print_only <(remoting_locales))',
809               ],
810               'action': [
811                 'python',
812                 '<(remoting_localize_path)',
813                 '--locale_dir', '<(webapp_locale_dir)',
814                 '--template', 'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2',
815                 '--locale_output',
816                 '<(SHARED_INTERMEDIATE_DIR)/remoting/uninstaller_resources/@{json_suffix}.lproj/InfoPlist.strings',
817                 '--encoding', 'utf-8',
818                 '<@(remoting_locales)',
819               ],
820             },
821           ],
822         },  # end of target 'remoting_infoplist_strings'
823       ],  # end of 'targets'
824     }],  # 'enable_remoting_host==1'
826     ['OS!="win" and enable_remoting_host==1', {
827       'conditions': [
828         ['OS=="linux" and branding=="Chrome" and chromeos==0', {
829           'variables': {
830             'deb_cmd': 'host/installer/linux/build-deb.sh',
831             'deb_filename': 'host/installer/<!(["<(deb_cmd)", "-p", "-s", "<(DEPTH)"])',
832             'packaging_outputs': [
833               '<(deb_filename)',
834               '<!(echo <(deb_filename) | sed -e "s/.deb$/.changes/")',
835               '<(PRODUCT_DIR)/remoting_me2me_host.debug',
836               '<(PRODUCT_DIR)/remoting_start_host.debug',
837               '<(PRODUCT_DIR)/remoting_native_messaging_host.debug',
838             ]
839           },
840           'targets': [
841             {
842               # Store the installer package(s) into a zip file so there is a
843               # consistent filename to reference for build archiving (i.e. in
844               # FILES.cfg). This also avoids possible conflicts with "wildcard"
845               # package handling in other build/signing scripts.
846               'target_name': 'remoting_me2me_host_archive',
847               'type': 'none',
848               'dependencies': [
849                 'remoting_me2me_host_deb_installer',
850               ],
851               'actions': [
852                 {
853                   #'variables': {
854                   #  'deb_cmd': 'host/installer/linux/build-deb.sh',
855                   #},
856                   'action_name': 'build_linux_installer_zip',
857                   'inputs': [
858                     '<@(packaging_outputs)',
859                   ],
860                   'outputs': [
861                     '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
862                   ],
863                   'action': [ 'zip', '-j', '-0', '<@(_outputs)', '<@(_inputs)' ],
864                 },
865               ],
866             },
867             {
868               'target_name': 'remoting_me2me_host_deb_installer',
869               'type': 'none',
870               'dependencies': [
871                 'remoting_me2me_host',
872                 'remoting_start_host',
873                 'remoting_native_messaging_host',
874               ],
875               'actions': [
876                 {
877                   'action_name': 'build_debian_package',
878                   'inputs': [
879                     '<(deb_cmd)',
880                     'host/installer/linux/Makefile',
881                     'host/installer/linux/debian/chrome-remote-desktop.init',
882                     'host/installer/linux/debian/chrome-remote-desktop.pam',
883                     'host/installer/linux/debian/compat',
884                     'host/installer/linux/debian/control',
885                     'host/installer/linux/debian/copyright',
886                     'host/installer/linux/debian/postinst',
887                     'host/installer/linux/debian/preinst',
888                     'host/installer/linux/debian/rules',
889                   ],
890                   'outputs': [
891                     '<@(packaging_outputs)',
892                   ],
893                   'action': [ '<(deb_cmd)', '-s', '<(DEPTH)' ],
894                 },
895               ],
896             },
897           ],
898         }],
899       ],
900       'targets': [
901         {
902           'target_name': 'remoting_me2me_host',
903           'type': 'executable',
904           'variables': { 'enable_wexit_time_destructors': 1, },
905           'dependencies': [
906             '../base/base.gyp:base',
907             '../base/base.gyp:base_i18n',
908             '../net/net.gyp:net',
909             '../third_party/webrtc/modules/modules.gyp:desktop_capture',
910             'remoting_base',
911             'remoting_breakpad',
912             'remoting_host',
913             'remoting_host_event_logger',
914             'remoting_host_logging',
915             'remoting_host_setup_base',
916             'remoting_infoplist_strings',
917             'remoting_jingle_glue',
918             'remoting_me2me_host_static',
919           ],
920           'defines': [
921             'VERSION=<(version_full)',
922           ],
923           'sources': [
924             'host/host_main.cc',
925             'host/host_main.h',
926             'host/remoting_me2me_host.cc',
927           ],
928           'conditions': [
929             ['OS=="mac"', {
930               'mac_bundle': 1,
931               'variables': {
932                  'host_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_HOST_BUNDLE_ID@")',
933               },
934               'xcode_settings': {
935                 'INFOPLIST_FILE': 'host/remoting_me2me_host-Info.plist',
936                 'INFOPLIST_PREPROCESS': 'YES',
937                 'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)" BUNDLE_ID="<(host_bundle_id)"',
938               },
939               'mac_bundle_resources': [
940                 'host/disconnect_window.xib',
941                 'host/remoting_me2me_host.icns',
942                 'host/remoting_me2me_host-Info.plist',
943                 '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x <(PRODUCT_DIR) <(remoting_locales))',
945                 # Localized strings for 'Info.plist'
946                 '<!@pymod_do_main(remoting_localize --locale_output '
947                     '"<(SHARED_INTERMEDIATE_DIR)/remoting/host_resources/@{json_suffix}.lproj/InfoPlist.strings" '
948                     '--print_only <(remoting_locales))',
949               ],
950               'mac_bundle_resources!': [
951                 'host/remoting_me2me_host-Info.plist',
952               ],
953               'conditions': [
954                 ['mac_breakpad==1', {
955                   'variables': {
956                     # A real .dSYM is needed for dump_syms to operate on.
957                     'mac_real_dsym': 1,
958                   },
959                   'copies': [
960                     {
961                       'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
962                       'files': [
963                         '<(PRODUCT_DIR)/crash_inspector',
964                         '<(PRODUCT_DIR)/crash_report_sender.app'
965                       ],
966                     },
967                   ],
968                   'dependencies': [
969                     '../breakpad/breakpad.gyp:dump_syms',
970                   ],
971                   'postbuilds': [
972                     {
973                       'postbuild_name': 'Dump Symbols',
974                       'variables': {
975                         'dump_product_syms_path':
976                             'scripts/mac/dump_product_syms',
977                       },
978                       'action': [
979                         '<(dump_product_syms_path)',
980                         '<(version_full)',
981                       ],
982                     },  # end of postbuild 'dump_symbols'
983                   ],  # end of 'postbuilds'
984                 }],  # mac_breakpad==1
985               ],  # conditions
986             }],  # OS=mac
987             ['OS=="linux" and linux_use_tcmalloc==1', {
988               'dependencies': [
989                 '../base/allocator/allocator.gyp:allocator',
990               ],
991             }],  # OS=linux
992           ],  # end of 'conditions'
993         },  # end of target 'remoting_me2me_host'
994         {
995           'target_name': 'remoting_native_messaging_host',
996           'type': 'executable',
997           'variables': { 'enable_wexit_time_destructors': 1, },
998           'dependencies': [
999             '../base/base.gyp:base',
1000             'remoting_host',
1001             'remoting_host_logging',
1002             'remoting_host_setup_base',
1003             'remoting_native_messaging_manifest',
1004           ],
1005           'defines': [
1006             'VERSION=<(version_full)',
1007           ],
1008           'sources': [
1009             'host/setup/native_messaging_host_main.cc',
1010           ],
1011           'conditions': [
1012             ['OS=="linux" and linux_use_tcmalloc==1', {
1013               'dependencies': [
1014                 '../base/allocator/allocator.gyp:allocator',
1015               ],
1016             }],
1017           ],
1018         },  # end of target 'remoting_native_messaging_host'
1019       ],  # end of 'targets'
1020     }],  # 'OS!="win" and enable_remoting_host==1'
1023     ['OS=="linux" and chromeos==0 and enable_remoting_host==1', {
1024       'targets': [
1025         # Linux breakpad processing
1026         {
1027           'target_name': 'remoting_linux_symbols',
1028           'type': 'none',
1029           'conditions': [
1030             ['linux_dump_symbols==1', {
1031               'actions': [
1032                 {
1033                   'action_name': 'dump_symbols',
1034                   'variables': {
1035                     'plugin_file': '<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
1036                   },
1037                   'inputs': [
1038                     '<(DEPTH)/build/linux/dump_app_syms',
1039                     '<(PRODUCT_DIR)/dump_syms',
1040                     '<(PRODUCT_DIR)/<(plugin_file)',
1041                   ],
1042                   'outputs': [
1043                     '<(PRODUCT_DIR)/<(plugin_file).breakpad.<(target_arch)',
1044                   ],
1045                   'action': ['<(DEPTH)/build/linux/dump_app_syms',
1046                              '<(PRODUCT_DIR)/dump_syms',
1047                              '<(linux_strip_binary)',
1048                              '<(PRODUCT_DIR)/<(plugin_file)',
1049                              '<@(_outputs)'],
1050                   'message': 'Dumping breakpad symbols to <(_outputs)',
1051                   'process_outputs_as_sources': 1,
1052                 },
1053               ],
1054               'dependencies': [
1055                 'remoting_host_plugin',
1056                 '../breakpad/breakpad.gyp:dump_syms',
1057               ],
1058             }],  # 'linux_dump_symbols==1'
1059           ],  # end of 'conditions'
1060         },  # end of target 'linux_symbols'
1061         {
1062           'target_name': 'remoting_start_host',
1063           'type': 'executable',
1064           'dependencies': [
1065             'remoting_host_setup_base',
1066           ],
1067           'sources': [
1068             'host/setup/start_host.cc',
1069           ],
1070           'conditions': [
1071             ['linux_use_tcmalloc==1', {
1072               'dependencies': [
1073                 '../base/allocator/allocator.gyp:allocator',
1074               ],
1075             }],
1076           ],
1077         },  # end of target 'remoting_start_host'
1078       ],  # end of 'targets'
1079     }],  # 'OS=="linux"'
1081     ['OS=="mac"', {
1082       'targets': [
1083         {
1084           'target_name': 'remoting_host_uninstaller',
1085           'type': 'executable',
1086           'mac_bundle': 1,
1087           'variables': {
1088             'bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_UNINSTALLER_BUNDLE_ID@")',
1089           },
1090           'dependencies': [
1091             '<(DEPTH)/base/base.gyp:base',
1092             'remoting_infoplist_strings',
1093           ],
1094           'sources': [
1095             'host/constants_mac.cc',
1096             'host/constants_mac.h',
1097             'host/installer/mac/uninstaller/remoting_uninstaller.h',
1098             'host/installer/mac/uninstaller/remoting_uninstaller.mm',
1099             'host/installer/mac/uninstaller/remoting_uninstaller_app.h',
1100             'host/installer/mac/uninstaller/remoting_uninstaller_app.mm',
1101           ],
1102           'xcode_settings': {
1103             'INFOPLIST_FILE': 'host/installer/mac/uninstaller/remoting_uninstaller-Info.plist',
1104             'INFOPLIST_PREPROCESS': 'YES',
1105             'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)" BUNDLE_ID="<(bundle_id)"',
1106           },
1107           'mac_bundle_resources': [
1108             'host/installer/mac/uninstaller/remoting_uninstaller.icns',
1109             'host/installer/mac/uninstaller/remoting_uninstaller.xib',
1110             'host/installer/mac/uninstaller/remoting_uninstaller-Info.plist',
1112             # Localized strings for 'Info.plist'
1113             '<!@pymod_do_main(remoting_localize --locale_output '
1114                 '"<(SHARED_INTERMEDIATE_DIR)/remoting/uninstaller_resources/@{json_suffix}.lproj/InfoPlist.strings" '
1115                 '--print_only <(remoting_locales))',
1116           ],
1117           'mac_bundle_resources!': [
1118             'host/installer/mac/uninstaller/remoting_uninstaller-Info.plist',
1119           ],
1120         },  # end of target 'remoting_host_uninstaller'
1122         # This packages up the files needed for the remoting host installer so
1123         # they can be sent off to be signed.
1124         # We don't build an installer here because we don't have signed binaries.
1125         {
1126           'target_name': 'remoting_me2me_host_archive',
1127           'type': 'none',
1128           'dependencies': [
1129             'remoting_host_prefpane',
1130             'remoting_host_uninstaller',
1131             'remoting_me2me_host',
1132             'remoting_native_messaging_host',
1133           ],
1134           'variables': {
1135             'host_name': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_FILE_NAME@")',
1136             'host_service_name': '<!(python <(version_py_path) -f <(branding_path) -t "@DAEMON_FILE_NAME@")',
1137             'host_uninstaller_name': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_UNINSTALLER_NAME@")',
1138             'bundle_prefix': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_UNINSTALLER_BUNDLE_PREFIX@")',
1139           },
1140           'actions': [
1141             {
1142               'action_name': 'Zip installer files for signing',
1143               'temp_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/remoting-me2me-host',
1144               'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
1145               'variables': {
1146                 'host_name_nospace': '<!(echo <(host_name) | sed "s/ //g")',
1147                 'host_service_name_nospace': '<!(echo <(host_service_name) | sed "s/ //g")',
1148                 'host_uninstaller_name_nospace': '<!(echo <(host_uninstaller_name) | sed "s/ //g")',
1149               },
1150               'generated_files': [
1151                 '<(PRODUCT_DIR)/remoting_host_prefpane.prefPane',
1152                 '<(PRODUCT_DIR)/remoting_me2me_host.app',
1153                 '<(PRODUCT_DIR)/remoting_host_uninstaller.app',
1154                 '<(PRODUCT_DIR)/remoting_native_messaging_host',
1155                 '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
1156               ],
1157               'generated_files_dst': [
1158                 'PreferencePanes/org.chromium.chromoting.prefPane',
1159                 'PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app',
1160                 'Applications/<(host_uninstaller_name).app',
1161                 'PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app/Contents/MacOS/native_messaging_host',
1162                 'Config/com.google.chrome.remote_desktop.json',
1163               ],
1164               'source_files': [
1165                 '<@(remoting_host_installer_mac_files)',
1166               ],
1167               'defs': [
1168                 'VERSION=<(version_full)',
1169                 'VERSION_SHORT=<(version_short)',
1170                 'VERSION_MAJOR=<(version_major)',
1171                 'VERSION_MINOR=<(version_minor)',
1172                 'HOST_NAME=<(host_name)',
1173                 'HOST_SERVICE_NAME=<(host_service_name)',
1174                 'HOST_UNINSTALLER_NAME=<(host_uninstaller_name)',
1175                 'HOST_PKG=<(host_name)',
1176                 'HOST_SERVICE_PKG=<(host_service_name_nospace)',
1177                 'HOST_UNINSTALLER_PKG=<(host_uninstaller_name_nospace)',
1178                 'BUNDLE_ID_HOST=<(bundle_prefix).<(host_name_nospace)',
1179                 'BUNDLE_ID_HOST_SERVICE=<(bundle_prefix).<(host_service_name_nospace)',
1180                 'BUNDLE_ID_HOST_UNINSTALLER=<(bundle_prefix).<(host_uninstaller_name_nospace)',
1181                 'DMG_VOLUME_NAME=<(host_name) <(version_full)',
1182                 'DMG_FILE_NAME=<!(echo <(host_name) | sed "s/ //g")-<(version_full)',
1183               ],
1184               'inputs': [
1185                 'host/installer/build-installer-archive.py',
1186                 '<@(_source_files)',
1187               ],
1188               'outputs': [
1189                 '<(_zip_path)',
1190               ],
1191               'action': [
1192                 'python',
1193                 'host/installer/build-installer-archive.py',
1194                 '<(_temp_dir)',
1195                 '<(_zip_path)',
1196                 '--source-file-roots',
1197                 '<@(remoting_host_installer_mac_roots)',
1198                 '--source-files',
1199                 '<@(_source_files)',
1200                 '--generated-files',
1201                 '<@(_generated_files)',
1202                 '--generated-files-dst',
1203                 '<@(_generated_files_dst)',
1204                 '--defs',
1205                 '<@(_defs)',
1206               ],
1207             },
1208           ],  # actions
1209         }, # end of target 'remoting_me2me_host_archive'
1211         {
1212           'target_name': 'remoting_host_prefpane',
1213           'type': 'loadable_module',
1214           'mac_bundle': 1,
1215           'product_extension': 'prefPane',
1216           'defines': [
1217             'JSON_USE_EXCEPTION=0',
1218           ],
1219           'dependencies': [
1220             'remoting_infoplist_strings',
1221           ],
1222           'include_dirs': [
1223             '../third_party/jsoncpp/overrides/include/',
1224             '../third_party/jsoncpp/source/include/',
1225             '../third_party/jsoncpp/source/src/lib_json/',
1226           ],
1228           # These source files are included directly, instead of adding target
1229           # dependencies, because the targets are not yet built for 64-bit on
1230           # Mac OS X - http://crbug.com/125116.
1231           #
1232           # TODO(lambroslambrou): Fix this when Chrome supports building for
1233           # Mac OS X 64-bit - http://crbug.com/128122.
1234           'sources': [
1235             '../third_party/jsoncpp/source/src/lib_json/json_reader.cpp',
1236             '../third_party/jsoncpp/overrides/src/lib_json/json_value.cpp',
1237             '../third_party/jsoncpp/source/src/lib_json/json_writer.cpp',
1238             '../third_party/modp_b64/modp_b64.cc',
1239             'host/constants_mac.cc',
1240             'host/constants_mac.h',
1241             'host/host_config.cc',
1242             'host/mac/me2me_preference_pane.h',
1243             'host/mac/me2me_preference_pane.mm',
1244             'host/mac/me2me_preference_pane_confirm_pin.h',
1245             'host/mac/me2me_preference_pane_confirm_pin.mm',
1246             'host/mac/me2me_preference_pane_disable.h',
1247             'host/mac/me2me_preference_pane_disable.mm',
1248           ],
1249           'link_settings': {
1250             'libraries': [
1251               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
1252               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
1253               '$(SDKROOT)/System/Library/Frameworks/PreferencePanes.framework',
1254               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
1255             ],
1256           },
1257           'variables': {
1258             'bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_PREFPANE_BUNDLE_ID@")',
1259           },
1260           'xcode_settings': {
1261             'ARCHS': ['i386', 'x86_64'],
1262             'GCC_ENABLE_OBJC_GC': 'supported',
1263             'INFOPLIST_FILE': 'host/mac/me2me_preference_pane-Info.plist',
1264             'INFOPLIST_PREPROCESS': 'YES',
1265             'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'VERSION_FULL="<(version_full)" VERSION_SHORT="<(version_short)" BUNDLE_ID="<(bundle_id)"',
1266           },
1267           'mac_bundle_resources': [
1268             'host/mac/me2me_preference_pane.xib',
1269             'host/mac/me2me_preference_pane_confirm_pin.xib',
1270             'host/mac/me2me_preference_pane_disable.xib',
1271             'host/mac/me2me_preference_pane-Info.plist',
1272             'resources/chromoting128.png',
1274             # Localized strings for 'Info.plist'
1275             '<!@pymod_do_main(remoting_localize --locale_output '
1276                 '"<(SHARED_INTERMEDIATE_DIR)/remoting/preference_pane_resources/@{json_suffix}.lproj/InfoPlist.strings" '
1277                 '--print_only <(remoting_locales))',
1278           ],
1279           'mac_bundle_resources!': [
1280             'host/mac/me2me_preference_pane-Info.plist',
1281           ],
1282           'conditions': [
1283             ['mac_breakpad==1', {
1284               'variables': {
1285                 # A real .dSYM is needed for dump_syms to operate on.
1286                 'mac_real_dsym': 1,
1287               },
1288             }],  # 'mac_breakpad==1'
1289           ],  # conditions
1290         },  # end of target 'remoting_host_prefpane'
1291       ],  # end of 'targets'
1292     }],  # 'OS=="mac"'
1294     ['OS=="win"', {
1295       'targets': [
1296         {
1297           'target_name': 'remoting_breakpad_tester',
1298           'type': 'executable',
1299           'variables': { 'enable_wexit_time_destructors': 1, },
1300           'dependencies': [
1301             '../base/base.gyp:base',
1302             'remoting_host_logging',
1303           ],
1304           'sources': [
1305             'tools/breakpad_tester_win.cc',
1306           ],
1307         },  # end of target 'remoting_breakpad_tester'
1308         {
1309           'target_name': 'remoting_lib_idl',
1310           'type': 'static_library',
1311           'sources': [
1312             'host/win/chromoting_lib_idl.templ',
1313             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.h',
1314             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
1315             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_i.c',
1316           ],
1317           # This target exports a hard dependency because dependent targets may
1318           # include chromoting_lib.h, a generated header.
1319           'hard_dependency': 1,
1320           'msvs_settings': {
1321             'VCMIDLTool': {
1322               'OutputDirectory': '<(SHARED_INTERMEDIATE_DIR)/remoting/host',
1323             },
1324           },
1325           'direct_dependent_settings': {
1326             'include_dirs': [
1327               '<(SHARED_INTERMEDIATE_DIR)',
1328             ],
1329           },
1330           'rules': [
1331             {
1332               'rule_name': 'generate_idl',
1333               'extension': 'templ',
1334               'outputs': [
1335                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
1336               ],
1337               'action': [
1338                 'python',
1339                 '<(version_py_path)',
1340                 '-e', "DAEMON_CONTROLLER_CLSID='<(daemon_controller_clsid)'",
1341                 '-e', "RDP_DESKTOP_SESSION_CLSID='<(rdp_desktop_session_clsid)'",
1342                 '<(RULE_INPUT_PATH)',
1343                 '<@(_outputs)',
1344               ],
1345               'process_outputs_as_sources': 1,
1346               'message': 'Generating <@(_outputs)',
1347               'msvs_cygwin_shell': 0,
1348             },
1349           ],
1350         },  # end of target 'remoting_lib_idl'
1352         # remoting_lib_ps builds the proxy/stub code generated by MIDL (see
1353         # remoting_lib_idl).
1354         {
1355           'target_name': 'remoting_lib_ps',
1356           'type': 'static_library',
1357           'defines': [
1358             # Prepend 'Ps' to the MIDL-generated routines. This includes
1359             # DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
1360             # DllUnregisterServer, and DllMain.
1361             'ENTRY_PREFIX=Ps',
1362             'REGISTER_PROXY_DLL',
1363           ],
1364           'dependencies': [
1365             'remoting_lib_idl',
1366           ],
1367           'sources': [
1368             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.dlldata.c',
1369             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_p.c',
1370           ],
1371         },  # end of target 'remoting_lib_ps'
1373         # Regenerates 'chromoting_lib.rc' (used to embed 'chromoting_lib.tlb'
1374         # into remoting_core.dll's resources) every time
1375         # 'chromoting_lib_idl.templ' changes. Making remoting_core depend on
1376         # both this and 'remoting_lib_idl' targets ensures that the resorces
1377         # are rebuilt every time the type library is updated. GYP alone is
1378         # not smart enough to figure out this dependency on its own.
1379         {
1380           'target_name': 'remoting_lib_rc',
1381           'type': 'none',
1382           'sources': [
1383             'host/win/chromoting_lib_idl.templ',
1384           ],
1385           'hard_dependency': 1,
1386           'direct_dependent_settings': {
1387             'include_dirs': [
1388               '<(SHARED_INTERMEDIATE_DIR)',
1389             ],
1390           },
1391           'rules': [
1392             {
1393               'rule_name': 'generate_rc',
1394               'extension': 'templ',
1395               'outputs': [
1396                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
1397               ],
1398               'action': [
1399                 'echo 1 typelib "remoting/host/chromoting_lib.tlb" > <@(_outputs)',
1400               ],
1401               'message': 'Generating <@(_outputs)',
1402               'msvs_cygwin_shell': 0,
1403             },
1404           ],
1405         },  # end of target 'remoting_lib_rc'
1406         {
1407           'target_name': 'remoting_configurer',
1408           'type': 'executable',
1409           'defines': [
1410             '_ATL_NO_EXCEPTIONS',
1411           ],
1412           'dependencies': [
1413             '../base/base.gyp:base',
1414             '../crypto/crypto.gyp:crypto',
1415             'remoting_host',
1416             'remoting_host_setup_base',
1417           ],
1418           'sources': [
1419             'host/branding.cc',
1420             'host/setup/win/host_configurer.cc',
1421             'host/setup/win/host_configurer.rc',
1422             'host/setup/win/host_configurer_window.cc',
1423             'host/setup/win/host_configurer_window.h',
1424             'host/setup/win/host_configurer_resource.h',
1425             'host/setup/win/load_string_from_resource.cc',
1426             'host/setup/win/load_string_from_resource.h',
1427             'host/setup/win/start_host_window.cc',
1428             'host/setup/win/start_host_window.h',
1429           ],
1430           'msvs_settings': {
1431             'VCLinkerTool': {
1432               'AdditionalOptions': [
1433                 "\"/manifestdependency:type='win32' "
1434                     "name='Microsoft.Windows.Common-Controls' "
1435                     "version='6.0.0.0' "
1436                     "processorArchitecture='*' "
1437                     "publicKeyToken='6595b64144ccf1df' language='*'\"",
1438               ],
1439               # 2 == /SUBSYSTEM:WINDOWS
1440               'SubSystem': '2',
1441             },
1442           },
1443         },  # end of target 'remoting_configurer'
1444         # The only difference between |remoting_console.exe| and
1445         # |remoting_host.exe| is that the former is a console application.
1446         # |remoting_console.exe| is used for debugging purposes.
1447         {
1448           'target_name': 'remoting_console',
1449           'type': 'executable',
1450           'variables': { 'enable_wexit_time_destructors': 1, },
1451           'defines': [
1452             'BINARY=BINARY_HOST_ME2ME',
1453           ],
1454           'dependencies': [
1455             'remoting_core',
1456             'remoting_version_resources',
1457           ],
1458           'sources': [
1459             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
1460             'host/win/entry_point.cc',
1461           ],
1462           'msvs_settings': {
1463             'VCManifestTool': {
1464               'AdditionalManifestFiles': [
1465                 'host/win/dpi_aware.manifest',
1466               ],
1467             },
1468             'VCLinkerTool': {
1469               'EntryPointSymbol': 'HostEntryPoint',
1470               'IgnoreAllDefaultLibraries': 'true',
1471               'SubSystem': '1', # /SUBSYSTEM:CONSOLE
1472             },
1473           },
1474         },  # end of target 'remoting_console'
1475         {
1476           'target_name': 'remoting_core',
1477           'type': 'shared_library',
1478           'variables': { 'enable_wexit_time_destructors': 1, },
1479           'defines' : [
1480             '_ATL_APARTMENT_THREADED',
1481             '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
1482             '_ATL_NO_AUTOMATIC_NAMESPACE',
1483             '_ATL_NO_EXCEPTIONS',
1484             'BINARY=BINARY_CORE',
1485             'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"',
1486             'RDP_DESKTOP_SESSION_CLSID="{<(rdp_desktop_session_clsid)}"',
1487             'HOST_IMPLEMENTATION',
1488             'ISOLATION_AWARE_ENABLED=1',
1489             'STRICT',
1490             'VERSION=<(version_full)',
1491           ],
1492           'dependencies': [
1493             '../base/base.gyp:base',
1494             '../base/base.gyp:base_static',
1495             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1496             '../ipc/ipc.gyp:ipc',
1497             '../net/net.gyp:net',
1498             '../third_party/webrtc/modules/modules.gyp:desktop_capture',
1499             'remoting_base',
1500             'remoting_breakpad',
1501             'remoting_core_resources',
1502             'remoting_host',
1503             'remoting_host_event_logger',
1504             'remoting_host_logging',
1505             'remoting_host_setup_base',
1506             'remoting_lib_idl',
1507             'remoting_lib_ps',
1508             'remoting_lib_rc',
1509             'remoting_me2me_host_static',
1510             'remoting_protocol',
1511             'remoting_version_resources',
1512           ],
1513           'sources': [
1514             '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc',
1515             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
1516             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
1517             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
1518             'host/chromoting_messages.cc',
1519             'host/chromoting_messages.h',
1520             'host/config_file_watcher.cc',
1521             'host/config_file_watcher.h',
1522             'host/daemon_process.cc',
1523             'host/daemon_process.h',
1524             'host/daemon_process_win.cc',
1525             'host/desktop_process.cc',
1526             'host/desktop_process.h',
1527             'host/desktop_process_main.cc',
1528             'host/desktop_session.cc',
1529             'host/desktop_session.h',
1530             'host/desktop_session_agent.cc',
1531             'host/desktop_session_agent.h',
1532             'host/desktop_session_win.cc',
1533             'host/desktop_session_win.h',
1534             'host/host_exit_codes.h',
1535             'host/host_exit_codes.cc',
1536             'host/host_export.h',
1537             'host/host_main.cc',
1538             'host/host_main.h',
1539             'host/ipc_constants.cc',
1540             'host/ipc_constants.h',
1541             'host/remoting_me2me_host.cc',
1542             'host/sas_injector.h',
1543             'host/sas_injector_win.cc',
1544             'host/verify_config_window_win.cc',
1545             'host/verify_config_window_win.h',
1546             'host/win/chromoting_module.cc',
1547             'host/win/chromoting_module.h',
1548             'host/win/core.cc',
1549             'host/win/core_resource.h',
1550             'host/win/elevated_controller.cc',
1551             'host/win/elevated_controller.h',
1552             'host/win/host_service.cc',
1553             'host/win/host_service.h',
1554             'host/win/omaha.cc',
1555             'host/win/omaha.h',
1556             'host/win/rdp_desktop_session.cc',
1557             'host/win/rdp_desktop_session.h',
1558             'host/win/unprivileged_process_delegate.cc',
1559             'host/win/unprivileged_process_delegate.h',
1560             'host/win/worker_process_launcher.cc',
1561             'host/win/worker_process_launcher.h',
1562             'host/win/wts_session_process_delegate.cc',
1563             'host/win/wts_session_process_delegate.h',
1564             'host/worker_process_ipc_delegate.h',
1565           ],
1566           'msvs_settings': {
1567             'VCManifestTool': {
1568               'EmbedManifest': 'true',
1569             },
1570             'VCLinkerTool': {
1571               'AdditionalDependencies': [
1572                 'comctl32.lib',
1573                 'rpcns4.lib',
1574                 'rpcrt4.lib',
1575                 'uuid.lib',
1576                 'wtsapi32.lib',
1577               ],
1578               'AdditionalOptions': [
1579                 "\"/manifestdependency:type='win32' "
1580                     "name='Microsoft.Windows.Common-Controls' "
1581                     "version='6.0.0.0' "
1582                     "processorArchitecture='*' "
1583                     "publicKeyToken='6595b64144ccf1df' language='*'\"",
1585                 # Export the proxy/stub entry points. Note that the generated
1586                 # routines have 'Ps' prefix to avoid conflicts with our own
1587                 # DllMain().
1588                 '/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE',
1589                 '/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE',
1590                 '/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE',
1591                 '/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE',
1592               ],
1593             },
1594           },
1595         },  # end of target 'remoting_core'
1596         {
1597           'target_name': 'remoting_core_resources',
1598           'type': 'none',
1599           'dependencies': [
1600             'remoting_resources',
1601           ],
1602           'hard_dependency': 1,
1603           'direct_dependent_settings': {
1604             'include_dirs': [
1605               '<(SHARED_INTERMEDIATE_DIR)',
1606             ],
1607           },
1608           'sources': [
1609             'host/win/core.rc.jinja2'
1610           ],
1611           'rules': [
1612             {
1613               'rule_name': 'version',
1614               'extension': 'jinja2',
1615               'outputs': [
1616                 '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc'
1617               ],
1618               'action': [
1619                 'python',
1620                 '<(remoting_localize_path)',
1621                 '--locale_dir', '<(webapp_locale_dir)',
1622                 '--template', '<(RULE_INPUT_PATH)',
1623                 '--output', '<@(_outputs)',
1624                 '<@(remoting_locales)',
1625               ],
1626               'message': 'Localizing the dialogs and strings'
1627             },
1628           ],
1629         },  # end of target 'remoting_core_resources'
1630         {
1631           'target_name': 'remoting_desktop',
1632           'type': 'executable',
1633           'variables': { 'enable_wexit_time_destructors': 1, },
1634           'defines': [
1635             'BINARY=BINARY_DESKTOP',
1636           ],
1637           'dependencies': [
1638             'remoting_core',
1639             'remoting_version_resources',
1640           ],
1641           'sources': [
1642             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
1643             'host/win/entry_point.cc',
1644           ],
1645           'msvs_settings': {
1646             'VCManifestTool': {
1647               'AdditionalManifestFiles': [
1648                 'host/win/dpi_aware.manifest',
1649               ],
1650             },
1651             'VCLinkerTool': {
1652               'EnableUAC': 'true',
1653               # Add 'level="requireAdministrator" uiAccess="true"' to
1654               # the manifest only for the official builds because it requires
1655               # the binary to be signed to work.
1656               'conditions': [
1657                 ['buildtype == "Official"', {
1658                   'UACExecutionLevel': 2,
1659                   'UACUIAccess': 'true',
1660                 }],
1661               ],
1662               'EntryPointSymbol': 'HostEntryPoint',
1663               'IgnoreAllDefaultLibraries': 'true',
1664               'SubSystem': '2', # /SUBSYSTEM:WINDOWS
1665             },
1666           },
1667         },  # end of target 'remoting_desktop'
1668         {
1669           'target_name': 'remoting_host_exe',
1670           'product_name': 'remoting_host',
1671           'type': 'executable',
1672           'variables': { 'enable_wexit_time_destructors': 1, },
1673           'defines': [
1674             'BINARY=BINARY_HOST_ME2ME',
1675           ],
1676           'dependencies': [
1677             'remoting_core',
1678             'remoting_version_resources',
1679           ],
1680           'sources': [
1681             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
1682             'host/win/entry_point.cc',
1683           ],
1684           'msvs_settings': {
1685             'VCManifestTool': {
1686               'AdditionalManifestFiles': [
1687                 'host/win/dpi_aware.manifest',
1688               ],
1689             },
1690             'VCLinkerTool': {
1691               'EntryPointSymbol': 'HostEntryPoint',
1692               'IgnoreAllDefaultLibraries': 'true',
1693               'ImportLibrary': '$(OutDir)\\lib\\remoting_host_exe.lib',
1694               'OutputFile': '$(OutDir)\\remoting_host.exe',
1695               'SubSystem': '2', # /SUBSYSTEM:WINDOWS
1696             },
1697           },
1698         },  # end of target 'remoting_host_exe'
1699         {
1700           'target_name': 'remoting_host_messages',
1701           'type': 'none',
1702           'dependencies': [
1703             'remoting_resources',
1704           ],
1705           'hard_dependency': 1,
1706           'direct_dependent_settings': {
1707             'include_dirs': [
1708               '<(SHARED_INTERMEDIATE_DIR)',
1709             ],
1710           },
1711           'sources': [
1712             'host/win/host_messages.mc.jinja2'
1713           ],
1714           'rules': [
1715             {
1716               'rule_name': 'localize',
1717               'extension': 'jinja2',
1718               'outputs': [
1719                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.mc',
1720               ],
1721               'action': [
1722                 'python',
1723                 '<(remoting_localize_path)',
1724                 '--locale_dir', '<(webapp_locale_dir)',
1725                 '--template', '<(RULE_INPUT_PATH)',
1726                 '--output', '<@(_outputs)',
1727                 '<@(remoting_locales)',
1728               ],
1729               'message': 'Localizing the event log messages'
1730             },
1731           ],
1732         },  # end of target 'remoting_host_messages'
1734         # Generates localized the version information resources for the Windows
1735         # binaries.
1736         # The substitution strings are taken from:
1737         #   - build/util/LASTCHANGE - the last source code revision.
1738         #   - chrome/VERSION - the major, build & patch versions.
1739         #   - remoting/VERSION - the chromoting patch version (and overrides
1740         #       for chrome/VERSION).
1741         #   - translated webapp strings
1742         {
1743           'target_name': 'remoting_version_resources',
1744           'type': 'none',
1745           'dependencies': [
1746             'remoting_resources',
1747           ],
1748           'hard_dependency': 1,
1749           'direct_dependent_settings': {
1750             'include_dirs': [
1751               '<(SHARED_INTERMEDIATE_DIR)',
1752             ],
1753           },
1754           'sources': [
1755             'host/win/version.rc.jinja2'
1756           ],
1757           'rules': [
1758             {
1759               'rule_name': 'version',
1760               'extension': 'jinja2',
1761               'variables': {
1762                 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
1763               },
1764               'inputs': [
1765                 '<(chrome_version_path)',
1766                 '<(lastchange_path)',
1767                 '<(remoting_version_path)',
1768               ],
1769               'outputs': [
1770                 '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
1771               ],
1772               'action': [
1773                 'python',
1774                 '<(remoting_localize_path)',
1775                 '--variables', '<(chrome_version_path)',
1776                 # |remoting_version_path| must be after |chrome_version_path|
1777                 # because it can contain overrides for the version numbers.
1778                 '--variables', '<(remoting_version_path)',
1779                 '--variables', '<(lastchange_path)',
1780                 '--locale_dir', '<(webapp_locale_dir)',
1781                 '--template', '<(RULE_INPUT_PATH)',
1782                 '--output', '<@(_outputs)',
1783                 '<@(remoting_locales)',
1784               ],
1785               'message': 'Localizing the version information'
1786             },
1787           ],
1788         },  # end of target 'remoting_version_resources'
1789       ],  # end of 'targets'
1790     }],  # 'OS=="win"'
1792     ['OS=="android"', {
1793       'targets': [
1794         {
1795           'target_name': 'remoting_client_jni',
1796           'type': 'shared_library',
1797           'dependencies': [
1798             'remoting_base',
1799             'remoting_client',
1800             'remoting_jingle_glue',
1801             'remoting_protocol',
1802             '../google_apis/google_apis.gyp:google_apis',
1803           ],
1804           'sources': [
1805             'client/jni/android_keymap.cc',
1806             'client/jni/android_keymap.h',
1807             'client/jni/chromoting_jni_instance.cc',
1808             'client/jni/chromoting_jni_instance.h',
1809             'client/jni/chromoting_jni_runtime.cc',
1810             'client/jni/chromoting_jni_runtime.h',
1811             'client/jni/jni_frame_consumer.cc',
1812             'client/jni/jni_frame_consumer.h',
1813             'client/jni/jni_interface.cc',
1814           ],
1815         },  # end of target 'remoting_client_jni'
1816         {
1817           'target_name': 'remoting_android_resources',
1818           'type': 'none',
1819           'copies': [
1820             {
1821               'destination': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/drawable',
1822               'files': [
1823                 'resources/chromoting128.png',
1824                 'resources/icon_host.png',
1825               ],
1826             },
1827             {
1828               'destination': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/layout',
1829               'files': [
1830                 'resources/layout/main.xml',
1831                 'resources/layout/host.xml',
1832                 'resources/layout/pin_dialog.xml',
1833               ],
1834             },
1835             {
1836               'destination': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/menu',
1837               'files': [
1838                 'resources/menu/chromoting_actionbar.xml',
1839                 'resources/menu/desktop_actionbar.xml',
1840               ],
1841             },
1842             {
1843               'destination': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/values',
1844               'files': [
1845                 'resources/strings.xml',
1846                 'resources/styles.xml',
1847               ],
1848             },
1849           ],
1850         },  # end of target 'remoting_android_resources'
1851         {
1852           'target_name': 'remoting_apk',
1853           'type': 'none',
1854           'dependencies': [
1855             'remoting_client_jni',
1856             'remoting_android_resources',
1857           ],
1858           'variables': {
1859             'apk_name': 'Chromoting',
1860             'android_app_version_name': '<(version_full)',
1861             'android_app_version_code': '<!(python ../build/util/lastchange.py --revision-only)',
1862             'manifest_package_name': 'org.chromium.chromoting',
1863             'native_lib_target': 'libremoting_client_jni',
1864             'java_in_dir': 'android/java',
1865             'additional_res_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res' ],
1866             'additional_input_paths': [
1867               'android/java/src/org/chromium/chromoting/Chromoting.java',
1868               'android/java/src/org/chromium/chromoting/Desktop.java',
1869               'android/java/src/org/chromium/chromoting/DesktopView.java',
1870               'android/java/src/org/chromium/chromoting/jni/JniInterface.java',
1871               '<(PRODUCT_DIR)/obj/remoting/remoting_android_resources.actions_rules_copies.stamp',
1872             ],
1873           },
1874           'includes': [ '../build/java_apk.gypi' ],
1875         },  # end of target 'remoting_apk'
1876       ],  # end of 'targets'
1877     }],  # 'OS=="android"'
1879     # The host installation is generated only if WiX is available. If
1880     # component build is used the produced installation will not work due to
1881     # missing DLLs. We build it anyway to make sure the GYP scripts are executed
1882     # by the bots.
1883     ['OS == "win" and wix_exists == "True" and sas_dll_exists == "True"', {
1884       'targets': [
1885         {
1886           'target_name': 'remoting_host_installation',
1887           'type': 'none',
1888           'dependencies': [
1889             'remoting_me2me_host_archive',
1890           ],
1891           'sources': [
1892             '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
1893           ],
1894           'outputs': [
1895             '<(PRODUCT_DIR)/chromoting.msi',
1896           ],
1897           'rules': [
1898             {
1899               'rule_name': 'zip2msi',
1900               'extension': 'zip',
1901               'inputs': [
1902                 'tools/zip2msi.py',
1903               ],
1904               'outputs': [
1905                 '<(PRODUCT_DIR)/chromoting.msi',
1906               ],
1907               'msvs_cygwin_shell': 0,
1908               'action': [
1909                 'python', 'tools/zip2msi.py',
1910                 '--wix_path', '<(wix_path)',
1911                 '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation',
1912                 '<(RULE_INPUT_PATH)',
1913                 '<@(_outputs)',
1914               ],
1915               'message': 'Generating <@(_outputs)',
1916             },
1917           ],
1918         },  # end of target 'remoting_host_installation'
1920         {
1921           'target_name': 'remoting_me2me_host_archive',
1922           'type': 'none',
1923           'dependencies': [
1924             'remoting_core',
1925             'remoting_desktop',
1926             'remoting_host_exe',
1927             'remoting_native_messaging_manifest',
1928           ],
1929           'compiled_inputs': [
1930             '<(PRODUCT_DIR)/remoting_core.dll',
1931             '<(PRODUCT_DIR)/remoting_desktop.exe',
1932             '<(PRODUCT_DIR)/remoting_host.exe',
1933           ],
1934           'compiled_inputs_dst': [
1935             'files/remoting_core.dll',
1936             'files/remoting_desktop.exe',
1937             'files/remoting_host.exe',
1938           ],
1939           'conditions': [
1940             ['buildtype == "Official"', {
1941               'defs': [
1942                 'OFFICIAL_BUILD=1',
1943               ],
1944             }, {  # else buildtype != "Official"
1945               'defs': [
1946                 'OFFICIAL_BUILD=0',
1947               ],
1948             }],
1949           ],
1950           'defs': [
1951             'BRANDING=<(branding)',
1952             'DAEMON_CONTROLLER_CLSID={<(daemon_controller_clsid)}',
1953             'RDP_DESKTOP_SESSION_CLSID={<(rdp_desktop_session_clsid)}',
1954             'VERSION=<(version_full)',
1955           ],
1956           'generated_files': [
1957             '<@(_compiled_inputs)',
1958             '<(sas_dll_path)/sas.dll',
1959             '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
1960             'resources/chromoting.ico',
1961           ],
1962           'generated_files_dst': [
1963             '<@(_compiled_inputs_dst)',
1964             'files/sas.dll',
1965             'files/com.google.chrome.remote_desktop.json',
1966             'files/chromoting.ico',
1967           ],
1968           'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
1969           'outputs': [
1970             '<(_zip_path)',
1971           ],
1972           'actions': [
1973             {
1974               'action_name': 'Zip installer files for signing',
1975               'temp_dir': '<(INTERMEDIATE_DIR)/installation',
1976               'source_files': [
1977                 '<@(remoting_host_installer_win_files)',
1978               ],
1979               'inputs': [
1980                 '<@(_compiled_inputs)',
1981                 '<(sas_dll_path)/sas.dll',
1982                 '<@(_source_files)',
1983                 'host/installer/build-installer-archive.py',
1984                 'resources/chromoting.ico',
1985               ],
1986               'outputs': [
1987                 '<(_zip_path)',
1988               ],
1989               'action': [
1990                 'python',
1991                 'host/installer/build-installer-archive.py',
1992                 '<(_temp_dir)',
1993                 '<(_zip_path)',
1994                 '--source-file-roots',
1995                 '<@(remoting_host_installer_win_roots)',
1996                 '--source-files',
1997                 '<@(_source_files)',
1998                 '--generated-files',
1999                 '<@(_generated_files)',
2000                 '--generated-files-dst',
2001                 '<@(_generated_files_dst)',
2002                 '--defs',
2003                 '<@(_defs)',
2004               ],
2005             },
2006           ],  # actions
2007         }, # end of target 'remoting_me2me_host_archive'
2008       ],  # end of 'targets'
2009     }],  # '<(wix_path) != ""'
2011   ],  # end of 'conditions'
2013   'targets': [
2014     {
2015       'target_name': 'remoting_breakpad',
2016       'type': 'static_library',
2017       'variables': { 'enable_wexit_time_destructors': 1, },
2018       'dependencies': [
2019         '../base/base.gyp:base',
2020       ],
2021       'sources': [
2022         'base/breakpad.h',
2023         'base/breakpad_linux.cc',
2024         'base/breakpad_mac.mm',
2025         'base/breakpad_win.cc',
2026       ],
2027       'conditions': [
2028         ['OS=="mac"', {
2029           'dependencies': [
2030             '../breakpad/breakpad.gyp:breakpad',
2031           ],
2032         }],
2033         ['OS=="win"', {
2034           'dependencies': [
2035             '../breakpad/breakpad.gyp:breakpad_handler',
2036           ],
2037         }],
2038       ],
2039     },  # end of target 'remoting_breakpad'
2041     {
2042       'target_name': 'remoting_client_plugin',
2043       'type': 'static_library',
2044       'variables': { 'enable_wexit_time_destructors': 1, },
2045       'defines': [
2046         'HAVE_STDINT_H',  # Required by on2_integer.h
2047       ],
2048       'dependencies': [
2049         'remoting_base',
2050         'remoting_client',
2051         'remoting_jingle_glue',
2052         '../net/net.gyp:net',
2053         '../ppapi/ppapi.gyp:ppapi_cpp_objects',
2054         '../skia/skia.gyp:skia',
2055         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
2056       ],
2057       'sources': [
2058         'client/plugin/chromoting_instance.cc',
2059         'client/plugin/chromoting_instance.h',
2060         'client/plugin/normalizing_input_filter.cc',
2061         'client/plugin/delegating_signal_strategy.cc',
2062         'client/plugin/delegating_signal_strategy.h',
2063         'client/plugin/normalizing_input_filter.h',
2064         'client/plugin/normalizing_input_filter_cros.cc',
2065         'client/plugin/normalizing_input_filter_mac.cc',
2066         'client/plugin/pepper_audio_player.cc',
2067         'client/plugin/pepper_audio_player.h',
2068         'client/plugin/pepper_entrypoints.cc',
2069         'client/plugin/pepper_entrypoints.h',
2070         'client/plugin/pepper_input_handler.cc',
2071         'client/plugin/pepper_input_handler.h',
2072         'client/plugin/pepper_network_manager.cc',
2073         'client/plugin/pepper_network_manager.h',
2074         'client/plugin/pepper_packet_socket_factory.cc',
2075         'client/plugin/pepper_packet_socket_factory.h',
2076         'client/plugin/pepper_plugin_thread_delegate.cc',
2077         'client/plugin/pepper_plugin_thread_delegate.h',
2078         'client/plugin/pepper_port_allocator.cc',
2079         'client/plugin/pepper_port_allocator.h',
2080         'client/plugin/pepper_token_fetcher.cc',
2081         'client/plugin/pepper_token_fetcher.h',
2082         'client/plugin/pepper_util.cc',
2083         'client/plugin/pepper_util.h',
2084         'client/plugin/pepper_view.cc',
2085         'client/plugin/pepper_view.h',
2086       ],
2087       'conditions' : [
2088         [ '(OS!="linux" or chromeos==0)', {
2089           'sources!': [
2090             'client/plugin/normalizing_input_filter_cros.cc',
2091           ],
2092         }],
2093       ],
2094     },  # end of target 'remoting_client_plugin'
2096     {
2097       'target_name': 'remoting_host_event_logger',
2098       'type': 'static_library',
2099       'variables': { 'enable_wexit_time_destructors': 1, },
2100       'dependencies': [
2101         'remoting_base',
2102       ],
2103       'sources': [
2104         'host/host_event_logger.h',
2105         'host/host_event_logger_posix.cc',
2106         'host/host_event_logger_win.cc',
2107       ],
2108       'conditions': [
2109         ['OS=="win"', {
2110           'dependencies': [
2111             'remoting_host_messages',
2112           ],
2113           'output_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/host',
2114           'sources': [
2115             '<(_output_dir)/remoting_host_messages.mc',
2116           ],
2117           'include_dirs': [
2118             '<(_output_dir)',
2119           ],
2120           'direct_dependent_settings': {
2121             'include_dirs': [
2122               '<(_output_dir)',
2123             ],
2124           },
2125           'rules': [
2126             # Rule to run the message compiler.
2127             {
2128               'rule_name': 'message_compiler',
2129               'extension': 'mc',
2130               'inputs': [ ],
2131               'outputs': [
2132                 '<(_output_dir)/remoting_host_messages.h',
2133                 '<(_output_dir)/remoting_host_messages.rc',
2134               ],
2135               'msvs_cygwin_shell': 0,
2136               'action': [
2137                 'mc.exe',
2138                 '-h', '<(_output_dir)',
2139                 '-r', '<(_output_dir)/.',
2140                 '-u',
2141                 '<(RULE_INPUT_PATH)',
2142               ],
2143               'process_outputs_as_sources': 1,
2144               'message': 'Running message compiler on <(RULE_INPUT_PATH).',
2145             },
2146           ],
2147         }],
2148       ],  # end of 'conditions'
2149     },  # end of target 'remoting_host_event_logger'
2151     {
2152       'target_name': 'remoting_webapp',
2153       'type': 'none',
2154       'variables': {
2155         'remoting_webapp_patch_files': [
2156           'webapp/appsv2.patch',
2157         ],
2158         'remoting_webapp_apps_v2_js_files': [
2159           'webapp/background.js',
2160         ],
2161       },
2162       'dependencies': [
2163         'remoting_resources',
2164         'remoting_host_plugin',
2165       ],
2166       'locale_files': [
2167         '<@(remoting_webapp_locale_files)',
2168       ],
2169       'conditions': [
2170         ['enable_remoting_host==1', {
2171           'locale_files': [
2172             '<@(remoting_locale_files)',
2173           ],
2174           'variables': {
2175               'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
2176           },
2177         }, {
2178           'variables': {
2179               'plugin_path': '',
2180           },
2181           'dependencies!': [
2182             'remoting_host_plugin',
2183           ],
2184         }],
2185       ],
2186       'actions': [
2187         {
2188           'action_name': 'Build Remoting WebApp',
2189           'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp',
2190           'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip',
2191           'inputs': [
2192             'webapp/build-webapp.py',
2193             '<(chrome_version_path)',
2194             '<(remoting_version_path)',
2195             '<@(remoting_webapp_files)',
2196             '<@(remoting_webapp_js_files)',
2197             '<@(_locale_files)',
2198           ],
2199           'conditions': [
2200             ['enable_remoting_host==1', {
2201               'inputs': [
2202                 '<(plugin_path)',
2203               ],
2204             }],
2205           ],
2206           'outputs': [
2207             '<(_output_dir)',
2208             '<(_zip_path)',
2209           ],
2210           'action': [
2211             'python', 'webapp/build-webapp.py',
2212             '<(buildtype)',
2213             '<(version_full)',
2214             '<(host_plugin_mime_type)',
2215             '<(_output_dir)',
2216             '<(_zip_path)',
2217             '<(plugin_path)',
2218             '<@(remoting_webapp_files)',
2219             '<@(remoting_webapp_js_files)',
2220             '--locales',
2221             '<@(_locale_files)',
2222           ],
2223           'msvs_cygwin_shell': 0,
2224         },
2225       ],
2226       'target_conditions': [
2227         # We cannot currently build the appsv2 version of WebApp on Windows as
2228         # there isn't a version of the "patch" tool available on windows. We
2229         # should remove this condition when we remove the reliance on patch.
2231         # We define this in a 'target_conditions' section because 'plugin_path'
2232         # is defined in a 'conditions' section so its value is not available
2233         # when gyp processes the 'actions' in a 'conditions" section.
2234         ['OS != "win"', {
2235           'actions': [
2236             {
2237               'action_name': 'Build Remoting WebApp V2',
2238               'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2',
2239               'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2.zip',
2240               'inputs': [
2241                 'webapp/build-webapp.py',
2242                 '<(chrome_version_path)',
2243                 '<(remoting_version_path)',
2244                 '<@(remoting_webapp_apps_v2_js_files)',
2245                 '<@(remoting_webapp_files)',
2246                 '<@(remoting_webapp_js_files)',
2247                 '<@(remoting_webapp_locale_files)',
2248                 '<@(remoting_webapp_patch_files)',
2249               ],
2250               'conditions': [
2251                 ['enable_remoting_host==1', {
2252                   'inputs': [
2253                     '<(plugin_path)',
2254                   ],
2255                 }],
2256               ],
2257               'outputs': [
2258                 '<(_output_dir)',
2259                 '<(_zip_path)',
2260               ],
2261               'action': [
2262                 'python', 'webapp/build-webapp.py',
2263                 '<(buildtype)',
2264                 '<(version_full)',
2265                 '<(host_plugin_mime_type)',
2266                 '<(_output_dir)',
2267                 '<(_zip_path)',
2268                 '<(plugin_path)',
2269                 '<@(remoting_webapp_apps_v2_js_files)',
2270                 '<@(remoting_webapp_files)',
2271                 '<@(remoting_webapp_js_files)',
2272                 '--locales',
2273                 '<@(remoting_webapp_locale_files)',
2274                 '--patches',
2275                 '<@(remoting_webapp_patch_files)',
2276               ],
2277               'msvs_cygwin_shell': 0,
2278             },
2279           ],
2280         }],
2281       ],
2282     }, # end of target 'remoting_webapp'
2284     # Generates 'native_messaging_manifest.json' to be included in the
2285     # installation.
2286     {
2287       'target_name': 'remoting_native_messaging_manifest',
2288       'type': 'none',
2289       'dependencies': [
2290         'remoting_resources',
2291       ],
2292       'variables': {
2293         'input': 'host/setup/native_messaging_manifest.json',
2294         'output': '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
2295       },
2296       'target_conditions': [
2297         ['OS == "win" or OS == "mac" or OS == "linux"', {
2298           'conditions': [
2299             [ 'OS == "win"', {
2300               'variables': {
2301                 'native_messaging_host_path': 'remoting_host.exe',
2302               },
2303             }], [ 'OS == "mac"', {
2304               'variables': {
2305                 'native_messaging_host_path': '/Library/PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app/Contents/MacOS/native_messaging_host',
2306               },
2307             }], ['OS == "linux"', {
2308               'variables': {
2309                 'native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
2310               },
2311             }], ['OS != "linux" and OS != "mac" and OS != "win"', {
2312               'variables': {
2313                 'native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
2314               },
2315             }],
2316           ],  # conditions
2317           'actions': [
2318             {
2319               'action_name': 'generate_manifest',
2320               'inputs': [
2321                 '<(remoting_localize_path)',
2322                 '<(input)',
2323               ],
2324               'outputs': [
2325                 '<(output)',
2326               ],
2327               'action': [
2328                 'python',
2329                 '<(remoting_localize_path)',
2330                 '--define', 'NATIVE_MESSAGING_HOST_PATH=<(native_messaging_host_path)',
2331                 '--locale_dir', '<(webapp_locale_dir)',
2332                 '--template', '<(input)',
2333                 '--locale_output',
2334                 '<(output)',
2335                 '--encoding', 'utf-8',
2336                 'en',
2337               ],
2338             },
2339           ],  # actions
2340         },
2341        ],
2342       ],  # target_conditions
2343     },  # end of target 'remoting_native_messaging_manifest'
2344     {
2345       'target_name': 'remoting_resources',
2346       'type': 'none',
2347       'variables': {
2348         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)',
2349         'grit_resource_ids': 'resources/resource_ids',
2350         'sources': [
2351           'base/resources_unittest.cc',
2352           'host/continue_window_mac.mm',
2353           'host/disconnect_window_mac.mm',
2354           'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2',
2355           'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2',
2356           'host/plugin/host_plugin-InfoPlist.strings.jinja2',
2357           'host/win/core.rc.jinja2',
2358           'host/win/host_messages.mc.jinja2',
2359           'host/win/version.rc.jinja2',
2360           'webapp/butter_bar.js',
2361           'webapp/client_screen.js',
2362           'webapp/error.js',
2363           'webapp/host_list.js',
2364           'webapp/host_setup_dialog.js',
2365           'webapp/host_table_entry.js',
2366           'webapp/main.html',
2367           'webapp/manifest.json',
2368           'webapp/paired_client_manager.js',
2369           'webapp/remoting.js',
2370         ],
2371       },
2372       'actions': [
2373         {
2374           'action_name': 'verify_resources',
2375           'inputs': [
2376             'resources/remoting_strings.grd',
2377             'tools/verify_resources.py',
2378             '<@(sources)'
2379           ],
2380           'outputs': [
2381             '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
2382           ],
2383           'action': [
2384             'python',
2385             'tools/verify_resources.py',
2386             '-t', '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
2387             '-r', 'resources/remoting_strings.grd',
2388             '<@(sources)',
2389          ],
2390         },
2391         {
2392           'action_name': 'remoting_strings',
2393           'variables': {
2394             'grit_grd_file': 'resources/remoting_strings.grd',
2395           },
2396           'includes': [ '../build/grit_action.gypi' ],
2397         },
2398         {
2399           'action_name': 'copy_locales',
2400           'variables': {
2401             'copy_output_dir%': '<(PRODUCT_DIR)',
2402           },
2403           'inputs': [
2404             'tools/build/remoting_copy_locales.py',
2405             '<!@pymod_do_main(remoting_copy_locales -i -p <(OS) -g <(grit_out_dir) <(remoting_locales))'
2406           ],
2407           'outputs': [
2408             '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x <(copy_output_dir) <(remoting_locales))'
2409           ],
2410           'action': [
2411             'python',
2412             'tools/build/remoting_copy_locales.py',
2413             '-p', '<(OS)',
2414             '-g', '<(grit_out_dir)',
2415             '-x', '<(copy_output_dir)/.',
2416             '<@(remoting_locales)',
2417           ],
2418         }
2419       ],
2420       'includes': [ '../build/grit_target.gypi' ],
2421     },  # end of target 'remoting_resources'
2423     {
2424       'target_name': 'remoting_base',
2425       'type': 'static_library',
2426       'variables': { 'enable_wexit_time_destructors': 1, },
2427       'dependencies': [
2428         '../base/base.gyp:base',
2429         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
2430         '../ui/ui.gyp:ui',
2431         '../net/net.gyp:net',
2432         '../skia/skia.gyp:skia',
2433         '../third_party/libvpx/libvpx.gyp:libvpx',
2434         '../third_party/libyuv/libyuv.gyp:libyuv',
2435         '../third_party/opus/opus.gyp:opus',
2436         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
2437         '../third_party/speex/speex.gyp:libspeex',
2438         '../media/media.gyp:media',
2439         '../media/media.gyp:shared_memory_support',
2440         'remoting_jingle_glue',
2441         'remoting_resources',
2442         'proto/chromotocol.gyp:chromotocol_proto_lib',
2443         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
2444       ],
2445       'export_dependent_settings': [
2446         '../base/base.gyp:base',
2447         '../net/net.gyp:net',
2448         '../skia/skia.gyp:skia',
2449         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
2450         'proto/chromotocol.gyp:chromotocol_proto_lib',
2451       ],
2452       # This target needs a hard dependency because dependent targets
2453       # depend on chromotocol_proto_lib for headers.
2454       'hard_dependency': 1,
2455       'sources': [
2456         'base/auth_token_util.cc',
2457         'base/auth_token_util.h',
2458         'base/auto_thread.cc',
2459         'base/auto_thread.h',
2460         'base/auto_thread_task_runner.cc',
2461         'base/auto_thread_task_runner.h',
2462         'base/capabilities.cc',
2463         'base/capabilities.h',
2464         'base/compound_buffer.cc',
2465         'base/compound_buffer.h',
2466         'base/constants.cc',
2467         'base/constants.h',
2468         'base/plugin_thread_task_runner.cc',
2469         'base/plugin_thread_task_runner.h',
2470         'base/rate_counter.cc',
2471         'base/rate_counter.h',
2472         'base/resources.h',
2473         'base/resources_linux.cc',
2474         'base/resources_mac.cc',
2475         'base/resources_win.cc',
2476         'base/rsa_key_pair.cc',
2477         'base/rsa_key_pair.h',
2478         'base/running_average.cc',
2479         'base/running_average.h',
2480         'base/scoped_sc_handle_win.h',
2481         'base/socket_reader.cc',
2482         'base/socket_reader.h',
2483         'base/typed_buffer.h',
2484         'base/url_request_context.cc',
2485         'base/url_request_context.h',
2486         'base/util.cc',
2487         'base/util.h',
2488         'base/vlog_net_log.cc',
2489         'base/vlog_net_log.h',
2490         'codec/audio_decoder.cc',
2491         'codec/audio_decoder.h',
2492         'codec/audio_decoder_opus.cc',
2493         'codec/audio_decoder_opus.h',
2494         'codec/audio_decoder_speex.cc',
2495         'codec/audio_decoder_speex.h',
2496         'codec/audio_decoder_verbatim.cc',
2497         'codec/audio_decoder_verbatim.h',
2498         'codec/audio_encoder.h',
2499         'codec/audio_encoder_opus.cc',
2500         'codec/audio_encoder_opus.h',
2501         'codec/audio_encoder_speex.cc',
2502         'codec/audio_encoder_speex.h',
2503         'codec/audio_encoder_verbatim.cc',
2504         'codec/audio_encoder_verbatim.h',
2505         'codec/video_decoder.h',
2506         'codec/video_decoder_verbatim.cc',
2507         'codec/video_decoder_verbatim.h',
2508         'codec/video_decoder_vp8.cc',
2509         'codec/video_decoder_vp8.h',
2510         'codec/video_encoder.h',
2511         'codec/video_encoder_verbatim.cc',
2512         'codec/video_encoder_verbatim.h',
2513         'codec/video_encoder_vp8.cc',
2514         'codec/video_encoder_vp8.h',
2515       ],
2516     },  # end of target 'remoting_base'
2518     {
2519       'target_name': 'remoting_host_logging',
2520       'type': 'static_library',
2521       'variables': { 'enable_wexit_time_destructors': 1, },
2522       'dependencies': [
2523         '../base/base.gyp:base',
2524       ],
2525       'sources': [
2526         'host/branding.cc',
2527         'host/branding.h',
2528         'host/logging.h',
2529         'host/logging_posix.cc',
2530         'host/logging_win.cc',
2531       ],
2532     },  # end of target 'remoting_host_logging'
2534     {
2535       'target_name': 'remoting_client',
2536       'type': 'static_library',
2537       'variables': { 'enable_wexit_time_destructors': 1, },
2538       'dependencies': [
2539         'remoting_base',
2540         'remoting_jingle_glue',
2541         'remoting_protocol',
2542         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
2543       ],
2544       'sources': [
2545         'client/audio_decode_scheduler.cc',
2546         'client/audio_decode_scheduler.h',
2547         'client/audio_player.cc',
2548         'client/audio_player.h',
2549         'client/chromoting_client.cc',
2550         'client/chromoting_client.h',
2551         'client/chromoting_stats.cc',
2552         'client/chromoting_stats.h',
2553         'client/client_config.cc',
2554         'client/client_config.h',
2555         'client/client_context.cc',
2556         'client/client_context.h',
2557         'client/client_user_interface.h',
2558         'client/frame_consumer.h',
2559         'client/frame_consumer_proxy.cc',
2560         'client/frame_consumer_proxy.h',
2561         'client/frame_producer.h',
2562         'client/key_event_mapper.cc',
2563         'client/key_event_mapper.h',
2564         'client/rectangle_update_decoder.cc',
2565         'client/rectangle_update_decoder.h',
2566       ],
2567     },  # end of target 'remoting_client'
2569     {
2570       'target_name': 'remoting_jingle_glue',
2571       'type': 'static_library',
2572       'variables': { 'enable_wexit_time_destructors': 1, },
2573       'dependencies': [
2574         '../base/base.gyp:base',
2575         '../jingle/jingle.gyp:jingle_glue',
2576         '../jingle/jingle.gyp:notifier',
2577         '../third_party/libjingle/libjingle.gyp:libjingle',
2578       ],
2579       'export_dependent_settings': [
2580         '../third_party/libjingle/libjingle.gyp:libjingle',
2581       ],
2582       'sources': [
2583         'jingle_glue/chromium_port_allocator.cc',
2584         'jingle_glue/chromium_port_allocator.h',
2585         'jingle_glue/chromium_socket_factory.cc',
2586         'jingle_glue/chromium_socket_factory.h',
2587         'jingle_glue/iq_sender.cc',
2588         'jingle_glue/iq_sender.h',
2589         'jingle_glue/jingle_info_request.cc',
2590         'jingle_glue/jingle_info_request.h',
2591         'jingle_glue/network_settings.h',
2592         'jingle_glue/signal_strategy.h',
2593         'jingle_glue/xmpp_signal_strategy.cc',
2594         'jingle_glue/xmpp_signal_strategy.h',
2595       ],
2596     },  # end of target 'remoting_jingle_glue'
2598     {
2599       'target_name': 'remoting_protocol',
2600       'type': 'static_library',
2601       'variables': { 'enable_wexit_time_destructors': 1, },
2602       'dependencies': [
2603         'remoting_base',
2604         'remoting_jingle_glue',
2605         '../crypto/crypto.gyp:crypto',
2606         '../jingle/jingle.gyp:jingle_glue',
2607         '../net/net.gyp:net',
2608       ],
2609       'export_dependent_settings': [
2610         'remoting_jingle_glue',
2611       ],
2612       'sources': [
2613         'protocol/audio_reader.cc',
2614         'protocol/audio_reader.h',
2615         'protocol/audio_stub.h',
2616         'protocol/audio_writer.cc',
2617         'protocol/audio_writer.h',
2618         'protocol/auth_util.cc',
2619         'protocol/auth_util.h',
2620         'protocol/authentication_method.cc',
2621         'protocol/authentication_method.h',
2622         'protocol/authenticator.cc',
2623         'protocol/authenticator.h',
2624         'protocol/buffered_socket_writer.cc',
2625         'protocol/buffered_socket_writer.h',
2626         'protocol/channel_authenticator.h',
2627         'protocol/channel_dispatcher_base.cc',
2628         'protocol/channel_dispatcher_base.h',
2629         'protocol/channel_multiplexer.cc',
2630         'protocol/channel_multiplexer.h',
2631         'protocol/client_control_dispatcher.cc',
2632         'protocol/client_control_dispatcher.h',
2633         'protocol/client_event_dispatcher.cc',
2634         'protocol/client_event_dispatcher.h',
2635         'protocol/client_stub.h',
2636         'protocol/clipboard_echo_filter.cc',
2637         'protocol/clipboard_echo_filter.h',
2638         'protocol/clipboard_filter.cc',
2639         'protocol/clipboard_filter.h',
2640         'protocol/clipboard_stub.h',
2641         'protocol/clipboard_thread_proxy.cc',
2642         'protocol/clipboard_thread_proxy.h',
2643         'protocol/connection_to_client.cc',
2644         'protocol/connection_to_client.h',
2645         'protocol/connection_to_host.cc',
2646         'protocol/connection_to_host.h',
2647         'protocol/content_description.cc',
2648         'protocol/content_description.h',
2649         'protocol/errors.h',
2650         'protocol/host_control_dispatcher.cc',
2651         'protocol/host_control_dispatcher.h',
2652         'protocol/host_event_dispatcher.cc',
2653         'protocol/host_event_dispatcher.h',
2654         'protocol/host_stub.h',
2655         'protocol/input_event_tracker.cc',
2656         'protocol/input_event_tracker.h',
2657         'protocol/input_filter.cc',
2658         'protocol/input_filter.h',
2659         'protocol/input_stub.h',
2660         'protocol/it2me_host_authenticator_factory.cc',
2661         'protocol/it2me_host_authenticator_factory.h',
2662         'protocol/jingle_messages.cc',
2663         'protocol/jingle_messages.h',
2664         'protocol/jingle_session.cc',
2665         'protocol/jingle_session.h',
2666         'protocol/jingle_session_manager.cc',
2667         'protocol/jingle_session_manager.h',
2668         'protocol/libjingle_transport_factory.cc',
2669         'protocol/libjingle_transport_factory.h',
2670         'protocol/me2me_host_authenticator_factory.cc',
2671         'protocol/me2me_host_authenticator_factory.h',
2672         'protocol/message_decoder.cc',
2673         'protocol/message_decoder.h',
2674         'protocol/message_reader.cc',
2675         'protocol/message_reader.h',
2676         'protocol/mouse_input_filter.cc',
2677         'protocol/mouse_input_filter.h',
2678         'protocol/name_value_map.h',
2679         'protocol/negotiating_authenticator_base.cc',
2680         'protocol/negotiating_authenticator_base.h',
2681         'protocol/negotiating_client_authenticator.cc',
2682         'protocol/negotiating_client_authenticator.h',
2683         'protocol/negotiating_host_authenticator.cc',
2684         'protocol/negotiating_host_authenticator.h',
2685         'protocol/pairing_authenticator_base.cc',
2686         'protocol/pairing_authenticator_base.h',
2687         'protocol/pairing_client_authenticator.cc',
2688         'protocol/pairing_client_authenticator.h',
2689         'protocol/pairing_host_authenticator.cc',
2690         'protocol/pairing_host_authenticator.h',
2691         'protocol/pairing_registry.cc',
2692         'protocol/pairing_registry.h',
2693         'protocol/protobuf_video_reader.cc',
2694         'protocol/protobuf_video_reader.h',
2695         'protocol/protobuf_video_writer.cc',
2696         'protocol/protobuf_video_writer.h',
2697         'protocol/session.h',
2698         'protocol/session_config.cc',
2699         'protocol/session_config.h',
2700         'protocol/session_manager.h',
2701         'protocol/ssl_hmac_channel_authenticator.cc',
2702         'protocol/ssl_hmac_channel_authenticator.h',
2703         'protocol/transport.cc',
2704         'protocol/transport.h',
2705         'protocol/transport_config.cc',
2706         'protocol/transport_config.h',
2707         'protocol/util.cc',
2708         'protocol/util.h',
2709         'protocol/third_party_authenticator_base.cc',
2710         'protocol/third_party_authenticator_base.h',
2711         'protocol/third_party_client_authenticator.cc',
2712         'protocol/third_party_client_authenticator.h',
2713         'protocol/third_party_host_authenticator.cc',
2714         'protocol/third_party_host_authenticator.h',
2715         'protocol/v2_authenticator.cc',
2716         'protocol/v2_authenticator.h',
2717         'protocol/video_reader.cc',
2718         'protocol/video_reader.h',
2719         'protocol/video_stub.h',
2720         'protocol/video_writer.cc',
2721         'protocol/video_writer.h',
2722       ],
2723     },  # end of target 'remoting_protocol'
2725     # Remoting unit tests
2726     {
2727       'target_name': 'remoting_unittests',
2728       'type': 'executable',
2729       'dependencies': [
2730         '../base/base.gyp:base',
2731         '../base/base.gyp:base_i18n',
2732         '../base/base.gyp:test_support_base',
2733         '../ipc/ipc.gyp:ipc',
2734         '../net/net.gyp:net_test_support',
2735         '../ppapi/ppapi.gyp:ppapi_cpp',
2736         '../testing/gmock.gyp:gmock',
2737         '../testing/gtest.gyp:gtest',
2738         '../ui/ui.gyp:ui',
2739         'remoting_base',
2740         'remoting_breakpad',
2741         'remoting_client',
2742         'remoting_client_plugin',
2743         'remoting_host',
2744         'remoting_host_event_logger',
2745         'remoting_host_setup_base',
2746         'remoting_jingle_glue',
2747         'remoting_protocol',
2748         'remoting_resources',
2749         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
2750       ],
2751       'defines': [
2752         'VERSION=<(version_full)',
2753       ],
2754       'include_dirs': [
2755         '../testing/gmock/include',
2756       ],
2757       'sources': [
2758         '../chrome/test/base/run_all_remoting_unittests.cc',
2759         'base/auth_token_util_unittest.cc',
2760         'base/auto_thread_task_runner_unittest.cc',
2761         'base/auto_thread_unittest.cc',
2762         'base/breakpad_win_unittest.cc',
2763         'base/capabilities_unittest.cc',
2764         'base/compound_buffer_unittest.cc',
2765         'base/rate_counter_unittest.cc',
2766         'base/resources_unittest.cc',
2767         'base/rsa_key_pair_unittest.cc',
2768         'base/running_average_unittest.cc',
2769         'base/test_rsa_key_pair.h',
2770         'base/typed_buffer_unittest.cc',
2771         'base/util_unittest.cc',
2772         'client/audio_player_unittest.cc',
2773         'client/key_event_mapper_unittest.cc',
2774         'client/plugin/normalizing_input_filter_cros_unittest.cc',
2775         'client/plugin/normalizing_input_filter_mac_unittest.cc',
2776         'codec/audio_encoder_opus_unittest.cc',
2777         'codec/codec_test.cc',
2778         'codec/codec_test.h',
2779         'codec/video_decoder_vp8_unittest.cc',
2780         'codec/video_encoder_verbatim_unittest.cc',
2781         'codec/video_encoder_vp8_unittest.cc',
2782         'host/audio_silence_detector_unittest.cc',
2783         'host/branding.cc',
2784         'host/branding.h',
2785         'host/capture_scheduler_unittest.cc',
2786         'host/chromoting_host_context_unittest.cc',
2787         'host/chromoting_host_unittest.cc',
2788         'host/client_session_unittest.cc',
2789         'host/config_file_watcher_unittest.cc',
2790         'host/daemon_process.cc',
2791         'host/daemon_process.h',
2792         'host/daemon_process_unittest.cc',
2793         'host/desktop_process.cc',
2794         'host/desktop_process.h',
2795         'host/desktop_process_unittest.cc',
2796         'host/desktop_session.cc',
2797         'host/desktop_session.h',
2798         'host/desktop_session_agent.cc',
2799         'host/desktop_session_agent.h',
2800         'host/heartbeat_sender_unittest.cc',
2801         'host/host_status_sender_unittest.cc',
2802         'host/host_change_notification_listener_unittest.cc',
2803         'host/host_mock_objects.cc',
2804         'host/host_mock_objects.h',
2805         'host/host_status_monitor_fake.h',
2806         'host/ipc_desktop_environment_unittest.cc',
2807         'host/json_host_config_unittest.cc',
2808         'host/linux/x_server_clipboard_unittest.cc',
2809         'host/local_input_monitor_unittest.cc',
2810         'host/log_to_server_unittest.cc',
2811         'host/pairing_registry_delegate_linux_unittest.cc',
2812         'host/pairing_registry_delegate_win_unittest.cc',
2813         'host/pin_hash_unittest.cc',
2814         'host/policy_hack/fake_policy_watcher.cc',
2815         'host/policy_hack/fake_policy_watcher.h',
2816         'host/policy_hack/mock_policy_callback.cc',
2817         'host/policy_hack/mock_policy_callback.h',
2818         'host/policy_hack/policy_watcher_unittest.cc',
2819         'host/register_support_host_request_unittest.cc',
2820         'host/remote_input_filter_unittest.cc',
2821         'host/resizing_host_observer_unittest.cc',
2822         'host/screen_capturer_fake.cc',
2823         'host/screen_capturer_fake.h',
2824         'host/screen_resolution_unittest.cc',
2825         'host/server_log_entry_unittest.cc',
2826         'host/setup/native_messaging_host_unittest.cc',
2827         'host/setup/native_messaging_reader_unittest.cc',
2828         'host/setup/native_messaging_writer_unittest.cc',
2829         'host/setup/oauth_helper_unittest.cc',
2830         'host/setup/pin_validator_unittest.cc',
2831         'host/token_validator_factory_impl_unittest.cc',
2832         'host/video_scheduler_unittest.cc',
2833         'host/win/rdp_client_unittest.cc',
2834         'host/win/worker_process_launcher.cc',
2835         'host/win/worker_process_launcher.h',
2836         'host/win/worker_process_launcher_unittest.cc',
2837         'jingle_glue/chromium_socket_factory_unittest.cc',
2838         'jingle_glue/fake_signal_strategy.cc',
2839         'jingle_glue/fake_signal_strategy.h',
2840         'jingle_glue/iq_sender_unittest.cc',
2841         'jingle_glue/mock_objects.cc',
2842         'jingle_glue/mock_objects.h',
2843         'protocol/authenticator_test_base.cc',
2844         'protocol/authenticator_test_base.h',
2845         'protocol/buffered_socket_writer_unittest.cc',
2846         'protocol/channel_multiplexer_unittest.cc',
2847         'protocol/clipboard_echo_filter_unittest.cc',
2848         'protocol/clipboard_filter_unittest.cc',
2849         'protocol/connection_tester.cc',
2850         'protocol/connection_tester.h',
2851         'protocol/connection_to_client_unittest.cc',
2852         'protocol/content_description_unittest.cc',
2853         'protocol/fake_authenticator.cc',
2854         'protocol/fake_authenticator.h',
2855         'protocol/fake_session.cc',
2856         'protocol/fake_session.h',
2857         'protocol/input_event_tracker_unittest.cc',
2858         'protocol/input_filter_unittest.cc',
2859         'protocol/jingle_messages_unittest.cc',
2860         'protocol/jingle_session_unittest.cc',
2861         'protocol/message_decoder_unittest.cc',
2862         'protocol/message_reader_unittest.cc',
2863         'protocol/mouse_input_filter_unittest.cc',
2864         'protocol/negotiating_authenticator_unittest.cc',
2865         'protocol/pairing_registry_unittest.cc',
2866         'protocol/ppapi_module_stub.cc',
2867         'protocol/protocol_mock_objects.cc',
2868         'protocol/protocol_mock_objects.h',
2869         'protocol/ssl_hmac_channel_authenticator_unittest.cc',
2870         'protocol/third_party_authenticator_unittest.cc',
2871         'protocol/v2_authenticator_unittest.cc',
2872       ],
2873       'conditions': [
2874         [ 'OS=="win"', {
2875           'defines': [
2876             '_ATL_NO_EXCEPTIONS',
2877           ],
2878           'include_dirs': [
2879             '../breakpad/src',
2880           ],
2881           'link_settings': {
2882             'libraries': [
2883               '-lrpcrt4.lib',
2884               '-lwtsapi32.lib',
2885             ],
2886           },
2887         }],
2888         [ 'OS=="mac" or (OS=="linux" and chromeos==0)', {
2889           # Javascript unittests are disabled on CrOS because they cause
2890           # valgrind and test errors.
2891           #
2892           # Javascript unittests are disabled on Windows because they add a
2893           # dependency on 'common_constants' which (only on Windows) requires
2894           # additional dependencies:
2895           #   '../content/content.gyp:content_common',
2896           #   'installer_util',
2897           # These targets are defined in .gypi files that would need to be
2898           # included here:
2899           #   '../chrome/chrome_common.gypi',
2900           #   '../chrome/chrome_installer.gypi',
2901           #   '../chrome/chrome_installer_util.gypi',
2902           # But we can't do that because ninja will complain about multiple
2903           # target definitions.
2904           # TODO(garykac): Move installer_util into a proper .gyp file so that
2905           # it can be included in multiple .gyp files.
2906           'includes': [
2907             '../chrome/js_unittest_rules.gypi',
2908           ],
2909           'dependencies': [
2910             '../chrome/common_constants.gyp:common_constants',
2911             '../v8/tools/gyp/v8.gyp:v8',
2912           ],
2913           'sources': [
2914             '../chrome/test/base/v8_unit_test.cc',
2915             '../chrome/test/base/v8_unit_test.h',
2916             'webapp/browser_globals.gtestjs',
2917             'webapp/all_js_load.gtestjs',
2918             'webapp/format_iq.gtestjs',
2919             '<@(remoting_webapp_js_files)',
2920           ],
2921         }],
2922         [ '(OS!="linux" or chromeos==0)', {
2923           'sources!': [
2924             'client/plugin/normalizing_input_filter_cros_unittest.cc',
2925           ],
2926         }],
2927         ['enable_remoting_host == 0', {
2928           'dependencies!': [
2929             'remoting_host',
2930             'remoting_host_setup_base',
2931           ],
2932           'sources/': [
2933             ['exclude', 'codec/*'],
2934             ['exclude', 'host/*'],
2935           ]
2936         }],
2937         ['toolkit_uses_gtk == 1', {
2938           'dependencies': [
2939             # Needed for the following #include chain:
2940             #   base/run_all_unittests.cc
2941             #   ../base/test_suite.h
2942             #   gtk/gtk.h
2943             '../build/linux/system.gyp:gtk',
2944             '../build/linux/system.gyp:ssl',
2945           ],
2946           'conditions': [
2947             [ 'linux_use_tcmalloc==1', {
2948                 'dependencies': [
2949                   '../base/allocator/allocator.gyp:allocator',
2950                 ],
2951               },
2952             ],
2953           ],
2954         }],  # end of 'toolkit_uses_gtk == 1'
2955       ],  # end of 'conditions'
2956     },  # end of target 'remoting_unittests'
2957   ],  # end of targets