Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / remoting / remoting.gyp
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.
4
5 {
6   'variables': {
7     'chromium_code': 1,
8
9     # Set this to run the jscompile checks after building the webapp.
10     'run_jscompile%': 0,
11
12     'variables': {
13       'conditions': [
14         # Enable the multi-process host on Windows by default.
15         ['OS=="win"', {
16           'remoting_multi_process%': 1,
17         }, {
18           'remoting_multi_process%': 0,
19         }],
20       ],
21     },
22
23     'remoting_multi_process%': '<(remoting_multi_process)',
24     'remoting_rdp_session%': 1,
25
26     'remoting_localize_path': 'tools/build/remoting_localize.py',
27
28     'branding_path': '../remoting/branding_<(branding)',
29
30     'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
31
32     'host_plugin_mime_type': 'application/vnd.chromium.remoting-host',
33
34     'conditions': [
35       ['OS=="mac"', {
36         'mac_bundle_id': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_BUNDLE_ID@")',
37         'mac_creator': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_CREATOR@")',
38         'host_plugin_extension': 'plugin',
39         'host_plugin_prefix': '',
40       }],
41       ['os_posix == 1 and OS != "mac" and target_arch == "ia32"', {
42         # linux 32 bit
43         'host_plugin_extension': 'ia32.so',
44         'host_plugin_prefix': 'lib',
45       }],
46       ['os_posix == 1 and OS != "mac" and target_arch == "x64"', {
47         # linux 64 bit
48         'host_plugin_extension': 'x64.so',
49         'host_plugin_prefix': 'lib',
50       }],
51       ['os_posix == 1 and OS != "mac" and target_arch == "arm"', {
52         'host_plugin_extension': 'arm.so',
53         'host_plugin_prefix': 'lib',
54       }],
55       ['os_posix == 1 and OS != "mac" and target_arch == "mipsel"', {
56         'host_plugin_extension': 'mipsel.so',
57         'host_plugin_prefix': 'lib',
58       }],
59       ['OS=="win"', {
60         'host_plugin_extension': 'dll',
61         'host_plugin_prefix': '',
62
63         # Each CLSID is a hash of the current version string salted with an
64         # arbitrary GUID. This ensures that the newly installed COM classes will
65         # be used during/after upgrade even if there are old instances running
66         # already.
67         # The IDs are not random to avoid rebuilding host when it's not
68         # necessary.
69         'daemon_controller_clsid':
70             '<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'655bd819-c08c-4b04-80c2-f160739ff6ef\'), \'<(version_full)\')")',
71         'rdp_desktop_session_clsid':
72             '<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'6a7699f0-ee43-43e7-aa30-a6738f9bd470\'), \'<(version_full)\')")',
73       }],
74     ],
75     'remoting_locales': [
76       'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es',
77       'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id',
78       'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT',
79       'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi',
80       'zh-CN', 'zh-TW',
81     ],
82     'remoting_locale_files': [
83       # Build the list of .pak files generated from remoting_strings.grd.
84       '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x '
85           '<(PRODUCT_DIR) <(remoting_locales))',
86     ],
87     'remoting_webapp_locale_files': [
88       # Build the list of .json files generated from remoting_strings.grd.
89       '<!@pymod_do_main(remoting_localize --locale_output '
90           '"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
91           '--print_only <(remoting_locales))',
92     ],
93   },
94
95   'includes': [
96     '../chrome/js_unittest_vars.gypi',
97     'remoting_android.gypi',
98     'remoting_client.gypi',
99     'remoting_host.gypi',
100     'remoting_test.gypi',
101     'remoting_version.gypi',
102     'remoting_webapp_files.gypi',
103   ],
104
105   'target_defaults': {
106     'defines': [
107       'BINARY_CORE=1',
108       'BINARY_DESKTOP=2',
109       'BINARY_HOST_ME2ME=3',
110       'BINARY_HOST_PLUGIN=4',
111     ],
112     'include_dirs': [
113       '..',  # Root of Chrome checkout
114     ],
115     'variables': {
116       'win_debug_RuntimeChecks': '0',
117     },
118     'conditions': [
119       ['OS=="mac" and mac_breakpad==1', {
120         'defines': [
121           'REMOTING_ENABLE_BREAKPAD'
122         ],
123       }],
124       ['OS=="win" and buildtype == "Official"', {
125         'defines': [
126           'REMOTING_ENABLE_BREAKPAD'
127         ],
128       }],
129       ['OS=="win" and remoting_multi_process != 0 and \
130           remoting_rdp_session != 0', {
131         'defines': [
132           'REMOTING_RDP_SESSION',
133         ],
134       }],
135       ['remoting_multi_process != 0', {
136         'defines': [
137           'REMOTING_MULTI_PROCESS',
138         ],
139       }],
140     ],
141   },
142
143   'targets': [
144     {
145       'target_name': 'remoting_breakpad',
146       'type': 'static_library',
147       'variables': { 'enable_wexit_time_destructors': 1, },
148       'dependencies': [
149         '../base/base.gyp:base',
150       ],
151       'sources': [
152         'base/breakpad.h',
153         'base/breakpad_linux.cc',
154         'base/breakpad_mac.mm',
155         'base/breakpad_win.cc',
156       ],
157       'conditions': [
158         ['OS=="mac"', {
159           'dependencies': [
160             '../breakpad/breakpad.gyp:breakpad',
161           ],
162         }],
163         ['OS=="win"', {
164           'dependencies': [
165             '../breakpad/breakpad.gyp:breakpad_handler',
166           ],
167         }],
168       ],
169     },  # end of target 'remoting_breakpad'
170
171     # TODO(garykac): This target should be moved into remoting_client.gypi.
172     # It can't currently because of an issue with GYP where initialized
173     # path variables in gypi includes cause a GYP failure.
174     # See crrev.com/15968005 and crrev.com/15972007 for context.
175     {
176       'target_name': 'remoting_webapp',
177       'type': 'none',
178       'variables': {
179         'remoting_webapp_patch_files': [
180           'webapp/appsv2.patch',
181         ],
182         'remoting_webapp_apps_v2_js_files': [
183           'webapp/background.js',
184         ],
185         'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp',
186         'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip',
187       },
188       'dependencies': [
189         'remoting_resources',
190         'remoting_host_plugin',
191       ],
192       'locale_files': [
193         '<@(remoting_webapp_locale_files)',
194       ],
195       'conditions': [
196         ['enable_remoting_host==1', {
197           'locale_files': [
198             '<@(remoting_locale_files)',
199           ],
200           'variables': {
201               'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
202           },
203         }, {
204           'variables': {
205               'plugin_path': '',
206           },
207           'dependencies!': [
208             'remoting_host_plugin',
209           ],
210         }],
211         ['run_jscompile != 0', {
212           'variables': {
213             'success_stamp': '<(PRODUCT_DIR)/remoting_webapp_jscompile.stamp',
214           },
215           'actions': [
216             {
217               'action_name': 'Verify remoting webapp',
218               'inputs': [
219                 '<@(remoting_webapp_js_files)',
220                 '<@(remoting_webapp_js_proto_files)',
221               ],
222               'outputs': [
223                 '<(success_stamp)',
224               ],
225               'action': [
226                 'python', 'tools/jscompile.py',
227                 '<@(remoting_webapp_js_files)',
228                 '<@(remoting_webapp_js_proto_files)',
229                 '--success-stamp',
230                 '<(success_stamp)'
231               ],
232             },
233           ],  # actions
234         }],
235       ],
236       'actions': [
237         {
238           'action_name': 'Build Remoting WebApp',
239           'inputs': [
240             'webapp/build-webapp.py',
241             '<(chrome_version_path)',
242             '<(remoting_version_path)',
243             '<@(remoting_webapp_files)',
244             '<@(_locale_files)',
245           ],
246           'conditions': [
247             ['enable_remoting_host==1', {
248               'inputs': [
249                 '<(plugin_path)',
250               ],
251             }],
252           ],
253           'outputs': [
254             '<(output_dir)',
255             '<(zip_path)',
256           ],
257           'action': [
258             'python', 'webapp/build-webapp.py',
259             '<(buildtype)',
260             '<(version_full)',
261             '<(host_plugin_mime_type)',
262             '<(output_dir)',
263             '<(zip_path)',
264             '<(plugin_path)',
265             '<@(remoting_webapp_files)',
266             '--locales',
267             '<@(_locale_files)',
268           ],
269         },
270       ],
271       'target_conditions': [
272         # We cannot currently build the appsv2 version of WebApp on Windows as
273         # there isn't a version of the "patch" tool available on windows. We
274         # should remove this condition when we remove the reliance on patch.
275
276         # We define this in a 'target_conditions' section because 'plugin_path'
277         # is defined in a 'conditions' section so its value is not available
278         # when gyp processes the 'actions' in a 'conditions" section.
279         ['OS != "win"', {
280           'actions': [
281             {
282               'action_name': 'Build Remoting WebApp V2',
283               'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2',
284               'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2.zip',
285               'inputs': [
286                 'webapp/build-webapp.py',
287                 '<(chrome_version_path)',
288                 '<(remoting_version_path)',
289                 '<@(remoting_webapp_apps_v2_js_files)',
290                 '<@(remoting_webapp_files)',
291                 '<@(remoting_webapp_locale_files)',
292                 '<@(remoting_webapp_patch_files)',
293               ],
294               'conditions': [
295                 ['enable_remoting_host==1', {
296                   'inputs': [
297                     '<(plugin_path)',
298                   ],
299                 }],
300               ],
301               'outputs': [
302                 '<(_output_dir)',
303                 '<(_zip_path)',
304               ],
305               'action': [
306                 'python', 'webapp/build-webapp.py',
307                 '<(buildtype)',
308                 '<(version_full)',
309                 '<(host_plugin_mime_type)',
310                 '<(_output_dir)',
311                 '<(_zip_path)',
312                 '<(plugin_path)',
313                 '<@(remoting_webapp_apps_v2_js_files)',
314                 '<@(remoting_webapp_files)',
315                 '--locales',
316                 '<@(remoting_webapp_locale_files)',
317                 '--patches',
318                 '<@(remoting_webapp_patch_files)',
319               ],
320             },
321           ],
322         }],
323       ],
324     }, # end of target 'remoting_webapp'
325
326     {
327       'target_name': 'remoting_resources',
328       'type': 'none',
329       'variables': {
330         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)',
331         'grit_resource_ids': 'resources/resource_ids',
332         'sources': [
333           'base/resources_unittest.cc',
334           'host/continue_window_mac.mm',
335           'host/disconnect_window_mac.mm',
336           'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2',
337           'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2',
338           'host/plugin/host_plugin-InfoPlist.strings.jinja2',
339           'host/win/core.rc.jinja2',
340           'host/win/host_messages.mc.jinja2',
341           'host/win/version.rc.jinja2',
342           'webapp/background.js',
343           'webapp/butter_bar.js',
344           'webapp/client_screen.js',
345           'webapp/error.js',
346           'webapp/host_list.js',
347           'webapp/host_setup_dialog.js',
348           'webapp/host_table_entry.js',
349           'webapp/main.html',
350           'webapp/manifest.json',
351           'webapp/paired_client_manager.js',
352           'webapp/remoting.js',
353         ],
354       },
355       'actions': [
356         {
357           'action_name': 'verify_resources',
358           'inputs': [
359             'resources/remoting_strings.grd',
360             'tools/verify_resources.py',
361             '<@(sources)'
362           ],
363           'outputs': [
364             '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
365           ],
366           'action': [
367             'python',
368             'tools/verify_resources.py',
369             '-t', '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
370             '-r', 'resources/remoting_strings.grd',
371             '<@(sources)',
372          ],
373         },
374         {
375           'action_name': 'remoting_strings',
376           'variables': {
377             'grit_grd_file': 'resources/remoting_strings.grd',
378           },
379           'includes': [ '../build/grit_action.gypi' ],
380         },
381         {
382           'action_name': 'copy_locales',
383           'variables': {
384             'copy_output_dir%': '<(PRODUCT_DIR)',
385           },
386           'inputs': [
387             'tools/build/remoting_copy_locales.py',
388             '<!@pymod_do_main(remoting_copy_locales -i -p <(OS) -g <(grit_out_dir) <(remoting_locales))'
389           ],
390           'outputs': [
391             '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x <(copy_output_dir) <(remoting_locales))'
392           ],
393           'action': [
394             'python', 'tools/build/remoting_copy_locales.py',
395             '-p', '<(OS)',
396             '-g', '<(grit_out_dir)',
397             '-x', '<(copy_output_dir)/.',
398             '<@(remoting_locales)',
399           ],
400         }
401       ],
402       'includes': [ '../build/grit_target.gypi' ],
403     },  # end of target 'remoting_resources'
404
405     {
406       'target_name': 'remoting_base',
407       'type': 'static_library',
408       'variables': { 'enable_wexit_time_destructors': 1, },
409       'dependencies': [
410         '../base/base.gyp:base',
411         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
412         '../ui/gfx/gfx.gyp:gfx',
413         '../ui/gfx/gfx.gyp:gfx_geometry',
414         '../ui/ui.gyp:ui',
415         '../net/net.gyp:net',
416         '../third_party/libvpx/libvpx.gyp:libvpx',
417         '../third_party/libyuv/libyuv.gyp:libyuv',
418         '../third_party/opus/opus.gyp:opus',
419         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
420         '../media/media.gyp:media',
421         '../media/media.gyp:shared_memory_support',
422         'remoting_resources',
423         'proto/chromotocol.gyp:chromotocol_proto_lib',
424         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
425       ],
426       'export_dependent_settings': [
427         '../base/base.gyp:base',
428         '../net/net.gyp:net',
429         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
430         'proto/chromotocol.gyp:chromotocol_proto_lib',
431       ],
432       # This target needs a hard dependency because dependent targets
433       # depend on chromotocol_proto_lib for headers.
434       'hard_dependency': 1,
435       'sources': [
436         'base/auth_token_util.cc',
437         'base/auth_token_util.h',
438         'base/auto_thread.cc',
439         'base/auto_thread.h',
440         'base/auto_thread_task_runner.cc',
441         'base/auto_thread_task_runner.h',
442         'base/capabilities.cc',
443         'base/capabilities.h',
444         'base/compound_buffer.cc',
445         'base/compound_buffer.h',
446         'base/constants.cc',
447         'base/constants.h',
448         'base/plugin_thread_task_runner.cc',
449         'base/plugin_thread_task_runner.h',
450         'base/rate_counter.cc',
451         'base/rate_counter.h',
452         'base/resources.h',
453         'base/resources_linux.cc',
454         'base/resources_mac.cc',
455         'base/resources_win.cc',
456         'base/rsa_key_pair.cc',
457         'base/rsa_key_pair.h',
458         'base/running_average.cc',
459         'base/running_average.h',
460         'base/scoped_sc_handle_win.h',
461         'base/socket_reader.cc',
462         'base/socket_reader.h',
463         'base/typed_buffer.h',
464         'base/url_request_context.cc',
465         'base/url_request_context.h',
466         'base/util.cc',
467         'base/util.h',
468         'base/vlog_net_log.cc',
469         'base/vlog_net_log.h',
470         'codec/audio_decoder.cc',
471         'codec/audio_decoder.h',
472         'codec/audio_decoder_opus.cc',
473         'codec/audio_decoder_opus.h',
474         'codec/audio_decoder_verbatim.cc',
475         'codec/audio_decoder_verbatim.h',
476         'codec/audio_encoder.h',
477         'codec/audio_encoder_opus.cc',
478         'codec/audio_encoder_opus.h',
479         'codec/audio_encoder_verbatim.cc',
480         'codec/audio_encoder_verbatim.h',
481         'codec/scoped_vpx_codec.cc',
482         'codec/scoped_vpx_codec.h',
483         'codec/video_decoder.h',
484         'codec/video_decoder_verbatim.cc',
485         'codec/video_decoder_verbatim.h',
486         'codec/video_decoder_vpx.cc',
487         'codec/video_decoder_vpx.h',
488         'codec/video_encoder.h',
489         'codec/video_encoder_verbatim.cc',
490         'codec/video_encoder_verbatim.h',
491         'codec/video_encoder_vpx.cc',
492         'codec/video_encoder_vpx.h',
493       ],
494     },  # end of target 'remoting_base'
495
496     {
497       'target_name': 'remoting_protocol',
498       'type': 'static_library',
499       'variables': { 'enable_wexit_time_destructors': 1, },
500       'dependencies': [
501         '../base/base.gyp:base',
502         '../crypto/crypto.gyp:crypto',
503         '../jingle/jingle.gyp:jingle_glue',
504         '../jingle/jingle.gyp:notifier',
505         '../net/net.gyp:net',
506         '../third_party/libjingle/libjingle.gyp:libjingle',
507         'remoting_base',
508       ],
509       'export_dependent_settings': [
510         '../third_party/libjingle/libjingle.gyp:libjingle',
511       ],
512       'sources': [
513         'jingle_glue/chromium_port_allocator.cc',
514         'jingle_glue/chromium_port_allocator.h',
515         'jingle_glue/chromium_socket_factory.cc',
516         'jingle_glue/chromium_socket_factory.h',
517         'jingle_glue/iq_sender.cc',
518         'jingle_glue/iq_sender.h',
519         'jingle_glue/jingle_info_request.cc',
520         'jingle_glue/jingle_info_request.h',
521         'jingle_glue/network_settings.h',
522         'jingle_glue/signal_strategy.h',
523         'jingle_glue/xmpp_signal_strategy.cc',
524         'jingle_glue/xmpp_signal_strategy.h',
525         'protocol/audio_reader.cc',
526         'protocol/audio_reader.h',
527         'protocol/audio_stub.h',
528         'protocol/audio_writer.cc',
529         'protocol/audio_writer.h',
530         'protocol/auth_util.cc',
531         'protocol/auth_util.h',
532         'protocol/authentication_method.cc',
533         'protocol/authentication_method.h',
534         'protocol/authenticator.cc',
535         'protocol/authenticator.h',
536         'protocol/buffered_socket_writer.cc',
537         'protocol/buffered_socket_writer.h',
538         'protocol/channel_authenticator.h',
539         'protocol/channel_dispatcher_base.cc',
540         'protocol/channel_dispatcher_base.h',
541         'protocol/channel_multiplexer.cc',
542         'protocol/channel_multiplexer.h',
543         'protocol/client_control_dispatcher.cc',
544         'protocol/client_control_dispatcher.h',
545         'protocol/client_event_dispatcher.cc',
546         'protocol/client_event_dispatcher.h',
547         'protocol/client_stub.h',
548         'protocol/clipboard_echo_filter.cc',
549         'protocol/clipboard_echo_filter.h',
550         'protocol/clipboard_filter.cc',
551         'protocol/clipboard_filter.h',
552         'protocol/clipboard_stub.h',
553         'protocol/clipboard_thread_proxy.cc',
554         'protocol/clipboard_thread_proxy.h',
555         'protocol/connection_to_client.cc',
556         'protocol/connection_to_client.h',
557         'protocol/connection_to_host.cc',
558         'protocol/connection_to_host.h',
559         'protocol/content_description.cc',
560         'protocol/content_description.h',
561         'protocol/errors.h',
562         'protocol/host_control_dispatcher.cc',
563         'protocol/host_control_dispatcher.h',
564         'protocol/host_event_dispatcher.cc',
565         'protocol/host_event_dispatcher.h',
566         'protocol/host_stub.h',
567         'protocol/input_event_tracker.cc',
568         'protocol/input_event_tracker.h',
569         'protocol/input_filter.cc',
570         'protocol/input_filter.h',
571         'protocol/input_stub.h',
572         'protocol/it2me_host_authenticator_factory.cc',
573         'protocol/it2me_host_authenticator_factory.h',
574         'protocol/jingle_messages.cc',
575         'protocol/jingle_messages.h',
576         'protocol/jingle_session.cc',
577         'protocol/jingle_session.h',
578         'protocol/jingle_session_manager.cc',
579         'protocol/jingle_session_manager.h',
580         'protocol/libjingle_transport_factory.cc',
581         'protocol/libjingle_transport_factory.h',
582         'protocol/me2me_host_authenticator_factory.cc',
583         'protocol/me2me_host_authenticator_factory.h',
584         'protocol/message_decoder.cc',
585         'protocol/message_decoder.h',
586         'protocol/message_reader.cc',
587         'protocol/message_reader.h',
588         'protocol/mouse_input_filter.cc',
589         'protocol/mouse_input_filter.h',
590         'protocol/name_value_map.h',
591         'protocol/negotiating_authenticator_base.cc',
592         'protocol/negotiating_authenticator_base.h',
593         'protocol/negotiating_client_authenticator.cc',
594         'protocol/negotiating_client_authenticator.h',
595         'protocol/negotiating_host_authenticator.cc',
596         'protocol/negotiating_host_authenticator.h',
597         'protocol/pairing_authenticator_base.cc',
598         'protocol/pairing_authenticator_base.h',
599         'protocol/pairing_client_authenticator.cc',
600         'protocol/pairing_client_authenticator.h',
601         'protocol/pairing_host_authenticator.cc',
602         'protocol/pairing_host_authenticator.h',
603         'protocol/pairing_registry.cc',
604         'protocol/pairing_registry.h',
605         'protocol/protobuf_video_reader.cc',
606         'protocol/protobuf_video_reader.h',
607         'protocol/protobuf_video_writer.cc',
608         'protocol/protobuf_video_writer.h',
609         'protocol/session.h',
610         'protocol/session_config.cc',
611         'protocol/session_config.h',
612         'protocol/session_manager.h',
613         'protocol/ssl_hmac_channel_authenticator.cc',
614         'protocol/ssl_hmac_channel_authenticator.h',
615         'protocol/transport.cc',
616         'protocol/transport.h',
617         'protocol/util.cc',
618         'protocol/util.h',
619         'protocol/third_party_authenticator_base.cc',
620         'protocol/third_party_authenticator_base.h',
621         'protocol/third_party_client_authenticator.cc',
622         'protocol/third_party_client_authenticator.h',
623         'protocol/third_party_host_authenticator.cc',
624         'protocol/third_party_host_authenticator.h',
625         'protocol/v2_authenticator.cc',
626         'protocol/v2_authenticator.h',
627         'protocol/video_reader.cc',
628         'protocol/video_reader.h',
629         'protocol/video_stub.h',
630         'protocol/video_writer.cc',
631         'protocol/video_writer.h',
632       ],
633     },  # end of target 'remoting_protocol'
634   ],  # end of targets
635 }