Make the cache entry stream index constants private.
[chromium-blink-merge.git] / remoting / remoting.gyp
blobe0f45f487ae60e89c04f27651b549d2943124734
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     # Set this to run the jscompile checks after building the webapp.
10     'run_jscompile%': 0,
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     },
23     'remoting_multi_process%': '<(remoting_multi_process)',
24     'remoting_rdp_session%': 1,
26     'remoting_localize_path': 'tools/build/remoting_localize.py',
28     'branding_path': '../remoting/branding_<(branding)',
30     'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
32     'host_plugin_mime_type': 'application/vnd.chromium.remoting-host',
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': '',
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   },
95   'includes': [
96     '../chrome/js_unittest_vars.gypi',
97     'remoting_android.gypi',
98     'remoting_client.gypi',
99     'remoting_host.gypi',
100     'remoting_srcs.gypi',
101     'remoting_test.gypi',
102     'remoting_version.gypi',
103     'remoting_webapp_files.gypi',
104   ],
106   'target_defaults': {
107     'defines': [
108       'BINARY_CORE=1',
109       'BINARY_DESKTOP=2',
110       'BINARY_HOST_ME2ME=3',
111       'BINARY_HOST_PLUGIN=4',
112       'BINARY_NATIVE_MESSAGING_HOST=5',
113       'BINARY_REMOTE_ASSISTANCE_HOST=6',
114     ],
115     'include_dirs': [
116       '..',  # Root of Chrome checkout
117     ],
118     'variables': {
119       'win_debug_RuntimeChecks': '0',
120     },
121     'conditions': [
122       ['OS=="mac" and mac_breakpad==1', {
123         'defines': [
124           'REMOTING_ENABLE_BREAKPAD'
125         ],
126       }],
127       ['OS=="win" and buildtype == "Official"', {
128         'defines': [
129           'REMOTING_ENABLE_BREAKPAD'
130         ],
131       }],
132       ['OS=="win" and remoting_multi_process != 0 and \
133           remoting_rdp_session != 0', {
134         'defines': [
135           'REMOTING_RDP_SESSION',
136         ],
137       }],
138       ['remoting_multi_process != 0', {
139         'defines': [
140           'REMOTING_MULTI_PROCESS',
141         ],
142       }],
143     ],
144   },
146   'targets': [
147     {
148       'target_name': 'remoting_breakpad',
149       'type': 'static_library',
150       'variables': { 'enable_wexit_time_destructors': 1, },
151       'dependencies': [
152         '../base/base.gyp:base',
153       ],
154       'sources': [
155         'base/breakpad.h',
156         'base/breakpad_linux.cc',
157         'base/breakpad_mac.mm',
158         'base/breakpad_win.cc',
159       ],
160       'conditions': [
161         ['OS=="mac"', {
162           'dependencies': [
163             '../breakpad/breakpad.gyp:breakpad',
164           ],
165         }],
166         ['OS=="win"', {
167           'dependencies': [
168             '../breakpad/breakpad.gyp:breakpad_handler',
169           ],
170         }],
171       ],
172     },  # end of target 'remoting_breakpad'
174     # TODO(garykac): This target should be moved into remoting_client.gypi.
175     # It can't currently because of an issue with GYP where initialized
176     # path variables in gypi includes cause a GYP failure.
177     # See crrev.com/15968005 and crrev.com/15972007 for context.
178     {
179       'target_name': 'remoting_webapp',
180       'type': 'none',
181       'variables': {
182         'remoting_webapp_patch_files': [
183           'webapp/appsv2.patch',
184         ],
185         'remoting_webapp_apps_v2_js_files': [
186           'webapp/background.js',
187         ],
188         'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp',
189         'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip',
190         'generated_html_files': [
191           '<(SHARED_INTERMEDIATE_DIR)/main.html',
192           '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
193         ],
194       },
195       'dependencies': [
196         'remoting_resources',
197         'remoting_host_plugin',
198         'remoting_webapp_html',
199       ],
200       'locale_files': [
201         '<@(remoting_webapp_locale_files)',
202       ],
203       'conditions': [
204         ['enable_remoting_host==1', {
205           'locale_files': [
206             '<@(remoting_locale_files)',
207           ],
208           'variables': {
209               'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
210           },
211         }, {
212           'variables': {
213               'plugin_path': '',
214           },
215           'dependencies!': [
216             'remoting_host_plugin',
217           ],
218         }],
219         ['run_jscompile != 0', {
220           'variables': {
221             'success_stamp': '<(PRODUCT_DIR)/remoting_webapp_jscompile.stamp',
222           },
223           'actions': [
224             {
225               'action_name': 'Verify remoting webapp',
226               'inputs': [
227                 '<@(remoting_webapp_all_js_files)',
228                 '<@(remoting_webapp_js_proto_files)',
229               ],
230               'outputs': [
231                 '<(success_stamp)',
232               ],
233               'action': [
234                 'python', 'tools/jscompile.py',
235                 '<@(remoting_webapp_all_js_files)',
236                 '<@(remoting_webapp_js_proto_files)',
237                 '--success-stamp',
238                 '<(success_stamp)'
239               ],
240             },
241           ],  # actions
242         }],
243       ],
244       'actions': [
245         {
246           'action_name': 'Build Remoting WebApp',
247           'inputs': [
248             'webapp/build-webapp.py',
249             '<(chrome_version_path)',
250             '<(remoting_version_path)',
251             '<@(generated_html_files)',
252             '<@(remoting_webapp_files)',
253             '<@(_locale_files)',
254           ],
255           'conditions': [
256             ['enable_remoting_host==1', {
257               'inputs': [
258                 '<(plugin_path)',
259               ],
260             }],
261           ],
262           'outputs': [
263             '<(output_dir)',
264             '<(zip_path)',
265           ],
266           'action': [
267             'python', 'webapp/build-webapp.py',
268             '<(buildtype)',
269             '<(version_full)',
270             '<(host_plugin_mime_type)',
271             '<(output_dir)',
272             '<(zip_path)',
273             '<(plugin_path)',
274             '<@(generated_html_files)',
275             '<@(remoting_webapp_files)',
276             '--locales',
277             '<@(_locale_files)',
278           ],
279         },
280       ],
281       'target_conditions': [
282         # We cannot currently build the appsv2 version of WebApp on Windows as
283         # there isn't a version of the "patch" tool available on windows. We
284         # should remove this condition when we remove the reliance on patch.
286         # We define this in a 'target_conditions' section because 'plugin_path'
287         # is defined in a 'conditions' section so its value is not available
288         # when gyp processes the 'actions' in a 'conditions" section.
289         ['OS != "win"', {
290           'actions': [
291             {
292               'action_name': 'Build Remoting WebApp V2',
293               'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2',
294               'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2.zip',
295               'inputs': [
296                 'webapp/build-webapp.py',
297                 '<(chrome_version_path)',
298                 '<(remoting_version_path)',
299                 '<@(remoting_webapp_apps_v2_js_files)',
300                 '<@(remoting_webapp_files)',
301                 '<@(remoting_webapp_locale_files)',
302                 '<@(remoting_webapp_patch_files)',
303               ],
304               'conditions': [
305                 ['enable_remoting_host==1', {
306                   'inputs': [
307                     '<(plugin_path)',
308                   ],
309                 }],
310               ],
311               'outputs': [
312                 '<(_output_dir)',
313                 '<(_zip_path)',
314               ],
315               'action': [
316                 'python', 'webapp/build-webapp.py',
317                 '<(buildtype)',
318                 '<(version_full)',
319                 '<(host_plugin_mime_type)',
320                 '<(_output_dir)',
321                 '<(_zip_path)',
322                 '<(plugin_path)',
323                 '<@(remoting_webapp_apps_v2_js_files)',
324                 '<@(remoting_webapp_files)',
325                 '--locales',
326                 '<@(remoting_webapp_locale_files)',
327                 '--patches',
328                 '<@(remoting_webapp_patch_files)',
329               ],
330             },
331           ],
332         }],
333       ],
334     }, # end of target 'remoting_webapp'
336     {
337       'target_name': 'remoting_webapp_html',
338       'type': 'none',
339       'actions': [
340         {
341           'action_name': 'Build Remoting Webapp main.html',
342           'inputs': [
343             'webapp/build-html.py',
344             '<(remoting_webapp_template_main)',
345             '<@(remoting_webapp_template_files)',
346           ],
347           'outputs': [
348             '<(SHARED_INTERMEDIATE_DIR)/main.html',
349           ],
350           'action': [
351             'python', 'webapp/build-html.py',
352             '<(SHARED_INTERMEDIATE_DIR)/main.html',
353             '<(remoting_webapp_template_main)',
354             '--template',
355             '<@(remoting_webapp_template_files)',
356             '--js',
357             '<@(remoting_webapp_main_html_js_files)',
358           ],
359         },
360         {
361           'action_name': 'Build Remoting Webapp wcs_sandbox.html',
362           'inputs': [
363             'webapp/build-html.py',
364             '<(remoting_webapp_template_wcs_sandbox)',
365           ],
366           'outputs': [
367             '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
368           ],
369           'action': [
370             'python', 'webapp/build-html.py',
371             '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
372             '<(remoting_webapp_template_wcs_sandbox)',
373             '--js',
374             '<@(remoting_webapp_wcs_sandbox_html_js_files)',
375           ],
376         },
377       ],
378     }, # end of target 'remoting_webapp_html'
380     {
381       'target_name': 'remoting_resources',
382       'type': 'none',
383       'dependencies': [
384         'remoting_webapp_html',
385       ],
386       'variables': {
387         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)',
388         'grit_resource_ids': 'resources/resource_ids',
389         'sources': [
390           '<(SHARED_INTERMEDIATE_DIR)/main.html',
391           'base/resources_unittest.cc',
392           'host/continue_window_mac.mm',
393           'host/disconnect_window_mac.mm',
394           'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2',
395           'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2',
396           'host/plugin/host_plugin-InfoPlist.strings.jinja2',
397           'host/win/core.rc.jinja2',
398           'host/win/host_messages.mc.jinja2',
399           'host/win/version.rc.jinja2',
400           'webapp/background.js',
401           'webapp/butter_bar.js',
402           'webapp/client_screen.js',
403           'webapp/error.js',
404           'webapp/host_list.js',
405           'webapp/host_setup_dialog.js',
406           'webapp/host_table_entry.js',
407           'webapp/manifest.json',
408           'webapp/paired_client_manager.js',
409           'webapp/remoting.js',
410         ],
411       },
412       'actions': [
413         {
414           'action_name': 'verify_resources',
415           'inputs': [
416             'resources/remoting_strings.grd',
417             'tools/verify_resources.py',
418             '<@(sources)'
419           ],
420           'outputs': [
421             '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
422           ],
423           'action': [
424             'python',
425             'tools/verify_resources.py',
426             '-t', '<(PRODUCT_DIR)/remoting_resources_verified.stamp',
427             '-r', 'resources/remoting_strings.grd',
428             '<@(sources)',
429          ],
430         },
431         {
432           'action_name': 'remoting_strings',
433           'variables': {
434             'grit_grd_file': 'resources/remoting_strings.grd',
435           },
436           'includes': [ '../build/grit_action.gypi' ],
437         },
438         {
439           'action_name': 'copy_locales',
440           'variables': {
441             'copy_output_dir%': '<(PRODUCT_DIR)',
442           },
443           'inputs': [
444             'tools/build/remoting_copy_locales.py',
445             '<!@pymod_do_main(remoting_copy_locales -i -p <(OS) -g <(grit_out_dir) <(remoting_locales))'
446           ],
447           'outputs': [
448             '<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x <(copy_output_dir) <(remoting_locales))'
449           ],
450           'action': [
451             'python', 'tools/build/remoting_copy_locales.py',
452             '-p', '<(OS)',
453             '-g', '<(grit_out_dir)',
454             '-x', '<(copy_output_dir)/.',
455             '<@(remoting_locales)',
456           ],
457         }
458       ],
459       'includes': [ '../build/grit_target.gypi' ],
460     },  # end of target 'remoting_resources'
462     {
463       'target_name': 'remoting_base',
464       'type': 'static_library',
465       'variables': { 'enable_wexit_time_destructors': 1, },
466       'dependencies': [
467         '../base/base.gyp:base',
468         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
469         '../ui/gfx/gfx.gyp:gfx',
470         '../ui/gfx/gfx.gyp:gfx_geometry',
471         '../ui/ui.gyp:ui',
472         '../net/net.gyp:net',
473         '../third_party/libvpx/libvpx.gyp:libvpx',
474         '../third_party/libyuv/libyuv.gyp:libyuv',
475         '../third_party/opus/opus.gyp:opus',
476         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
477         '../media/media.gyp:media',
478         '../media/media.gyp:shared_memory_support',
479         'remoting_resources',
480         'proto/chromotocol.gyp:chromotocol_proto_lib',
481         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
482       ],
483       'export_dependent_settings': [
484         '../base/base.gyp:base',
485         '../net/net.gyp:net',
486         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
487         'proto/chromotocol.gyp:chromotocol_proto_lib',
488       ],
489       # This target needs a hard dependency because dependent targets
490       # depend on chromotocol_proto_lib for headers.
491       'hard_dependency': 1,
492       'sources': [
493         '<@(remoting_base_sources)',
494       ],
495     },  # end of target 'remoting_base'
497     {
498       'target_name': 'remoting_protocol',
499       'type': 'static_library',
500       'variables': { 'enable_wexit_time_destructors': 1, },
501       'dependencies': [
502         '../base/base.gyp:base',
503         '../crypto/crypto.gyp:crypto',
504         '../jingle/jingle.gyp:jingle_glue',
505         '../jingle/jingle.gyp:notifier',
506         '../net/net.gyp:net',
507         '../third_party/libjingle/libjingle.gyp:libjingle',
508         'remoting_base',
509       ],
510       'export_dependent_settings': [
511         '../third_party/libjingle/libjingle.gyp:libjingle',
512       ],
513       'sources': [
514         '<@(remoting_protocol_sources)',
515       ],
516     },  # end of target 'remoting_protocol'
517   ],  # end of targets