Show a dialog if a user denies a android runtime permission.
[chromium-blink-merge.git] / remoting / remoting_host_win.gypi
blob78952d5fe488d8d8171397a2dfa4a48caea2ee00
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'remoting_host_installer_win_roots': [
8       'host/installer/win/',
9     ],
10     'remoting_host_installer_win_files': [
11       'host/installer/win/chromoting.wxs',
12       'host/installer/win/parameters.json',
13     ],
14   },  # end of 'variables'
16   'targets': [
17     {
18       'target_name': 'remoting_breakpad_tester',
19       'type': 'executable',
20       'variables': { 'enable_wexit_time_destructors': 1, },
21       'dependencies': [
22         '../base/base.gyp:base',
23         'remoting_host',
24       ],
25       'sources': [
26         'tools/breakpad_tester_win.cc',
27       ],
28     },  # end of target 'remoting_breakpad_tester'
29     {
30       # GN version: //remoting/host:remoting_lib_idl
31       'target_name': 'remoting_lib_idl',
32       'type': 'static_library',
33       'sources': [
34         'host/win/chromoting_lib_idl.templ',
35         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.h',
36         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
37         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_i.c',
38       ],
39       # This target exports a hard dependency because dependent targets may
40       # include chromoting_lib.h, a generated header.
41       'hard_dependency': 1,
42       'msvs_settings': {
43         'VCMIDLTool': {
44           'OutputDirectory': '<(SHARED_INTERMEDIATE_DIR)/remoting/host',
45         },
46       },
47       'direct_dependent_settings': {
48         'include_dirs': [
49           '<(SHARED_INTERMEDIATE_DIR)',
50         ],
51       },
52       'rules': [
53         {
54           # GN version: //remoting/host:generate_idl
55           'rule_name': 'generate_idl',
56           'extension': 'templ',
57           'outputs': [
58             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
59           ],
60           'action': [
61             'python', '<(version_py_path)',
62             '-e', "DAEMON_CONTROLLER_CLSID='<(daemon_controller_clsid)'",
63             '-e', "RDP_DESKTOP_SESSION_CLSID='<(rdp_desktop_session_clsid)'",
64             '<(RULE_INPUT_PATH)',
65             '<@(_outputs)',
66           ],
67           'process_outputs_as_sources': 1,
68           'message': 'Generating <@(_outputs)',
69         },
70       ],
71     },  # end of target 'remoting_lib_idl'
73     # remoting_lib_ps builds the proxy/stub code generated by MIDL (see
74     # remoting_lib_idl).
75     {
76       'target_name': 'remoting_lib_ps',
77       'type': 'static_library',
78       'defines': [
79         # Prepend 'Ps' to the MIDL-generated routines. This includes
80         # DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
81         # DllUnregisterServer, and DllMain.
82         'ENTRY_PREFIX=Ps',
83         'REGISTER_PROXY_DLL',
84       ],
85       'dependencies': [
86         'remoting_lib_idl',
87       ],
88       'sources': [
89         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.dlldata.c',
90         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_p.c',
91       ],
92       'variables': {
93         'clang_warning_flags': [
94           # MIDL generated code has a habit of omitting optional braces.
95           '-Wno-missing-braces',
96           # Source files generated by the MIDL compiler trigger warnings with
97           # -Wincompatible-pointer-types enabled.
98           '-Wno-incompatible-pointer-types',
99           # Generated code contains unused variables.
100           '-Wno-unused-variable',
101         ],
102       },
103     },  # end of target 'remoting_lib_ps'
105     # Regenerates 'chromoting_lib.rc' (used to embed 'chromoting_lib.tlb'
106     # into remoting_core.dll's resources) every time
107     # 'chromoting_lib_idl.templ' changes. Making remoting_core depend on
108     # both this and 'remoting_lib_idl' targets ensures that the resorces
109     # are rebuilt every time the type library is updated. GYP alone is
110     # not smart enough to figure out this dependency on its own.
111     {
112       'target_name': 'remoting_lib_rc',
113       'type': 'none',
114       'sources': [
115         'host/win/chromoting_lib_idl.templ',
116       ],
117       'hard_dependency': 1,
118       'direct_dependent_settings': {
119         'include_dirs': [
120           '<(SHARED_INTERMEDIATE_DIR)',
121         ],
122       },
123       'rules': [
124         {
125           'rule_name': 'generate_rc',
126           'extension': 'templ',
127           'outputs': [
128             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
129           ],
130           'action': [
131             'echo 1 typelib "remoting/host/chromoting_lib.tlb" > <@(_outputs)',
132           ],
133           'message': 'Generating <@(_outputs)',
134         },
135       ],
136     },  # end of target 'remoting_lib_rc'
137     # The only difference between |remoting_console.exe| and
138     # |remoting_host.exe| is that the former is a console application.
139     # |remoting_console.exe| is used for debugging purposes.
140     {
141       'target_name': 'remoting_console',
142       'type': 'executable',
143       'variables': { 'enable_wexit_time_destructors': 1, },
144       'defines': [
145         'BINARY=BINARY_HOST_ME2ME',
146       ],
147       'dependencies': [
148         'remoting_core',
149         'remoting_windows_resources',
150       ],
151       'sources': [
152         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
153         'host/win/entry_point.cc',
154       ],
155       'msvs_settings': {
156         'VCManifestTool': {
157           'AdditionalManifestFiles': [
158             'host/win/dpi_aware.manifest',
159           ],
160         },
161         'VCLinkerTool': {
162           'EntryPointSymbol': 'HostEntryPoint',
163           'IgnoreAllDefaultLibraries': 'true',
164           'SubSystem': '1', # /SUBSYSTEM:CONSOLE
165         },
166       },
167     },  # end of target 'remoting_console'
168     {
169       'target_name': 'remoting_core',
170       'type': 'shared_library',
171       'variables': { 'enable_wexit_time_destructors': 1, },
172       'defines' : [
173         '_ATL_APARTMENT_THREADED',
174         '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
175         '_ATL_NO_AUTOMATIC_NAMESPACE',
176         '_ATL_NO_EXCEPTIONS',
177         'BINARY=BINARY_CORE',
178         'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"',
179         'RDP_DESKTOP_SESSION_CLSID="{<(rdp_desktop_session_clsid)}"',
180         'HOST_IMPLEMENTATION',
181         'ISOLATION_AWARE_ENABLED=1',
182         'STRICT',
183         'VERSION=<(version_full)',
184       ],
185       'dependencies': [
186         '../base/base.gyp:base',
187         '../base/base.gyp:base_static',
188         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
189         '../ipc/ipc.gyp:ipc',
190         '../net/net.gyp:net',
191         '../third_party/webrtc/modules/modules.gyp:desktop_capture',
192         'remoting_base',
193         'remoting_breakpad',
194         'remoting_host',
195         'remoting_host_setup_base',
196         'remoting_it2me_host_static',
197         'remoting_lib_idl',
198         'remoting_lib_ps',
199         'remoting_lib_rc',
200         'remoting_me2me_host_static',
201         'remoting_native_messaging_base',
202         'remoting_protocol',
203         'remoting_windows_resources',
204       ],
205       'sources': [
206         '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc',
207         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
208         '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
209         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
210         'host/desktop_process_main.cc',
211         'host/host_main.cc',
212         'host/host_main.h',
213         'host/it2me/it2me_native_messaging_host_main.cc',
214         'host/it2me/it2me_native_messaging_host_main.h',
215         'host/setup/me2me_native_messaging_host_main.cc',
216         'host/setup/me2me_native_messaging_host_main.h',
217         'host/win/chromoting_module.cc',
218         'host/win/chromoting_module.h',
219         'host/win/core.cc',
220         'host/win/core_resource.h',
221         'host/win/host_service.cc',
222         'host/win/host_service.h',
223         'host/win/omaha.cc',
224         'host/win/omaha.h',
225         'host/win/rdp_desktop_session.cc',
226         'host/win/rdp_desktop_session.h',
227         'host/win/unprivileged_process_delegate.cc',
228         'host/win/unprivileged_process_delegate.h',
229         'host/win/worker_process_launcher.cc',
230         'host/win/worker_process_launcher.h',
231         'host/win/wts_session_process_delegate.cc',
232         'host/win/wts_session_process_delegate.h',
233         'host/worker_process_ipc_delegate.h',
234       ],
235       'msvs_settings': {
236         'VCManifestTool': {
237           'EmbedManifest': 'true',
238           'AdditionalManifestFiles': [
239             'host/win/common-controls.manifest',
240           ],
241         },
242         'VCLinkerTool': {
243           'AdditionalDependencies': [
244             'comctl32.lib',
245             'rpcns4.lib',
246             'rpcrt4.lib',
247             'uuid.lib',
248             'wtsapi32.lib',
249           ],
250           'AdditionalOptions': [
251             # Export the proxy/stub entry points. Note that the generated
252             # routines have 'Ps' prefix to avoid conflicts with our own
253             # DllMain().
254             '/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE',
255             '/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE',
256             '/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE',
257             '/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE',
258           ],
259         },
260         'conditions': [
261           ['clang==1', {
262             # atlapp.h contains a global "using namespace WTL;".
263             # TODO: Remove once remoting/host/verify_config_window_win.h no
264             # longer depends on atlapp.h, http://crbug.com/5027
265             'VCCLCompilerTool': {
266               'AdditionalOptions': ['-Wno-header-hygiene'],
267             },
268           }],
269         ],
270       },
271     },  # end of target 'remoting_core'
272     {
273       'target_name': 'remoting_desktop',
274       'type': 'executable',
275       'variables': { 'enable_wexit_time_destructors': 1, },
276       'defines': [
277         'BINARY=BINARY_DESKTOP',
278       ],
279       'dependencies': [
280         'remoting_core',
281         'remoting_windows_resources',
282       ],
283       'sources': [
284         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
285         'host/win/entry_point.cc',
286       ],
287       'msvs_settings': {
288         'VCManifestTool': {
289           'AdditionalManifestFiles': [
290             'host/win/dpi_aware.manifest',
291           ],
292         },
293         'VCLinkerTool': {
294           'EnableUAC': 'true',
295           # Add 'level="requireAdministrator" uiAccess="true"' to
296           # the manifest only for the official builds because it requires
297           # the binary to be signed to work.
298           'conditions': [
299             ['buildtype == "Official"', {
300               'UACExecutionLevel': 2,
301               'UACUIAccess': 'true',
302             }],
303           ],
304           'EntryPointSymbol': 'HostEntryPoint',
305           'IgnoreAllDefaultLibraries': 'true',
306           'SubSystem': '2', # /SUBSYSTEM:WINDOWS
307         },
308       },
309     },  # end of target 'remoting_desktop'
310     {
311       'target_name': 'remoting_me2me_host',
312       'product_name': 'remoting_host',
313       'type': 'executable',
314       'variables': { 'enable_wexit_time_destructors': 1, },
315       'defines': [
316         'BINARY=BINARY_HOST_ME2ME',
317       ],
318       'dependencies': [
319         'remoting_core',
320         'remoting_windows_resources',
321       ],
322       'sources': [
323         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
324         'host/win/entry_point.cc',
325       ],
326       'msvs_settings': {
327         'VCManifestTool': {
328           'AdditionalManifestFiles': [
329             'host/win/dpi_aware.manifest',
330           ],
331         },
332         'VCLinkerTool': {
333           'EntryPointSymbol': 'HostEntryPoint',
334           'IgnoreAllDefaultLibraries': 'true',
335           'OutputFile': '$(OutDir)\\remoting_host.exe',
336           'SubSystem': '2', # /SUBSYSTEM:WINDOWS
337         },
338       },
339     },  # end of target 'remoting_me2me_host'
340     {
341       'target_name': 'remoting_me2me_native_messaging_host',
342       'type': 'executable',
343       'product_name': 'remoting_native_messaging_host',
344       'variables': { 'enable_wexit_time_destructors': 1, },
345       'defines' : [
346         'BINARY=BINARY_NATIVE_MESSAGING_HOST',
347       ],
348       'dependencies': [
349         'remoting_core',
350         'remoting_windows_resources',
351       ],
352       'sources': [
353         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
354         'host/setup/me2me_native_messaging_host_entry_point.cc',
355       ],
356       'msvs_settings': {
357         'VCLinkerTool': {
358           'IgnoreAllDefaultLibraries': 'true',
359           'SubSystem': '1', # /SUBSYSTEM:CONSOLE
360         },
361       },
362     },  # end of target 'remoting_me2me_native_messaging_host'
363     {
364       'target_name': 'remoting_it2me_native_messaging_host',
365       'type': 'executable',
366       'product_name': 'remote_assistance_host',
367       'variables': { 'enable_wexit_time_destructors': 1, },
368       'dependencies': [
369         'remoting_core',
370         'remoting_windows_resources',
371       ],
372       'sources': [
373         '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
374         'host/it2me/it2me_native_messaging_host_entry_point.cc',
375       ],
376       'defines' : [
377         'BINARY=BINARY_REMOTE_ASSISTANCE_HOST',
378       ],
379       'msvs_settings': {
380         'VCManifestTool': {
381           'EmbedManifest': 'true',
382           'AdditionalManifestFiles': [
383             'host/win/common-controls.manifest',
384             'host/win/dpi_aware.manifest',
385           ],
386         },
387         'VCLinkerTool': {
388           'IgnoreAllDefaultLibraries': 'true',
389           'SubSystem': '1', # /SUBSYSTEM:CONSOLE
390           'AdditionalDependencies': [
391             'comctl32.lib',
392           ],
393         },
394       },
395     },  # end of target 'remoting_it2me_native_messaging_host'
396     {
397       # GN version: //remoting/host:messages
398       'target_name': 'remoting_host_messages',
399       'type': 'none',
400       'dependencies': [
401         'remoting_resources',
402       ],
403       'hard_dependency': 1,
404       'direct_dependent_settings': {
405         'include_dirs': [
406           '<(SHARED_INTERMEDIATE_DIR)',
407         ],
408       },
409       'sources': [
410         'host/win/host_messages.mc.jinja2'
411       ],
412       'rules': [
413         {
414           'rule_name': 'localize',
415           'extension': 'jinja2',
416           'outputs': [
417             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.mc',
418           ],
419           'action': [
420             'python', '<(remoting_localize_path)',
421             '--locale_dir', '<(webapp_locale_dir)',
422             '--template', '<(RULE_INPUT_PATH)',
423             '--output', '<@(_outputs)',
424             '--encoding', 'utf-16',
425             '<@(remoting_locales)',
426           ],
427           'message': 'Localizing the event log messages'
428         },
429       ],
430     },  # end of target 'remoting_host_messages'
432     # Generates localized resources for the Windows binaries.
433     # The substitution strings are taken from:
434     #   - build/util/LASTCHANGE - the last source code revision. There is
435     #       no explicit dependency on this file to avoid rebuilding the host
436     #       after unrelated changes.
437     #   - chrome/VERSION - the major, build & patch versions.
438     #   - remoting/VERSION - the chromoting patch version (and overrides
439     #       for chrome/VERSION).
440     #   - translated webapp strings
441     {
442       'target_name': 'remoting_windows_resources',
443       'type': 'none',
444       'dependencies': [
445         'remoting_resources',
446       ],
447       'hard_dependency': 1,
448       'direct_dependent_settings': {
449         'include_dirs': [
450           '<(SHARED_INTERMEDIATE_DIR)',
451         ],
452       },
453       'sources': [
454         'host/win/core.rc.jinja2',
455         'host/win/version.rc.jinja2',
456       ],
457       'rules': [
458         {
459           'rule_name': 'version',
460           'extension': 'jinja2',
461           'variables': {
462             'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
463           },
464           'inputs': [
465             '<(chrome_version_path)',
466             '<(remoting_version_path)',
467           ],
468           'outputs': [
469             '<(SHARED_INTERMEDIATE_DIR)/remoting/<(RULE_INPUT_ROOT)',
470           ],
471           'action': [
472             'python', '<(remoting_localize_path)',
473             '--variables', '<(chrome_version_path)',
474             # |remoting_version_path| must be after |chrome_version_path|
475             # because it can contain overrides for the version numbers.
476             '--variables', '<(remoting_version_path)',
477             '--variables', '<(lastchange_path)',
478             '--locale_dir', '<(webapp_locale_dir)',
479             '--template', '<(RULE_INPUT_PATH)',
480             '--output', '<@(_outputs)',
481             '--encoding', 'utf-16',
482             '<@(remoting_locales)',
483           ],
484           'message': 'Localizing the version information'
485         },
486       ],
487     },  # end of target 'remoting_windows_resources'
488   ],  # end of 'targets'
490   'conditions': [
491     # The host installation is generated only if WiX is available. If
492     # component build is used the produced installation will not work due to
493     # missing DLLs. We build it anyway to make sure the GYP scripts are executed
494     # by the bots.
495     ['wix_exists == "True" and sas_dll_exists == "True"', {
496       'targets': [
497         {
498           'target_name': 'remoting_host_installation',
499           'type': 'none',
500           'dependencies': [
501             'remoting_me2me_host_archive',
502           ],
503           'sources': [
504             '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
505           ],
506           'outputs': [
507             '<(PRODUCT_DIR)/chromoting.msi',
508           ],
509           'rules': [
510             {
511               'rule_name': 'zip2msi',
512               'extension': 'zip',
513               'inputs': [
514                 'tools/zip2msi.py',
515               ],
516               'outputs': [
517                 '<(PRODUCT_DIR)/chromoting.msi',
518               ],
519               'action': [
520                 'python', 'tools/zip2msi.py',
521                 '--wix_path', '<(wix_path)',
522                 '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation',
523                 '--target_arch', '<(target_arch)',
524                 '<(RULE_INPUT_PATH)',
525                 '<@(_outputs)',
526               ],
527               'message': 'Generating <@(_outputs)',
528             },
529           ],
530         },  # end of target 'remoting_host_installation'
532         {
533           'target_name': 'remoting_me2me_host_archive',
534           'type': 'none',
535           'dependencies': [
536             '<(icu_gyp_path):icudata',
537             'remoting_core',
538             'remoting_desktop',
539             'remoting_it2me_native_messaging_host',
540             'remoting_me2me_host',
541             'remoting_me2me_native_messaging_host',
542             'remoting_native_messaging_manifests',
543           ],
544           'compiled_inputs': [
545             '<(PRODUCT_DIR)/remote_assistance_host.exe',
546             '<(PRODUCT_DIR)/remoting_core.dll',
547             '<(PRODUCT_DIR)/remoting_desktop.exe',
548             '<(PRODUCT_DIR)/remoting_host.exe',
549             '<(PRODUCT_DIR)/remoting_native_messaging_host.exe',
550           ],
551           'compiled_inputs_dst': [
552             'files/remote_assistance_host.exe',
553             'files/remoting_core.dll',
554             'files/remoting_desktop.exe',
555             'files/remoting_host.exe',
556             'files/remoting_native_messaging_host.exe',
557           ],
558           'conditions': [
559             ['buildtype == "Official"', {
560               'defs': [
561                 'OFFICIAL_BUILD=1',
562               ],
563             }, {  # else buildtype != "Official"
564               'defs': [
565                 'OFFICIAL_BUILD=0',
566               ],
567             }],
568           ],
569           'defs': [
570             'BRANDING=<(branding)',
571             'DAEMON_CONTROLLER_CLSID={<(daemon_controller_clsid)}',
572             'RDP_DESKTOP_SESSION_CLSID={<(rdp_desktop_session_clsid)}',
573             'VERSION=<(version_full)',
574           ],
575           'generated_files': [
576             '<@(_compiled_inputs)',
577             '<(sas_dll_path)/sas.dll',
578             '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_assistance.json',
579             '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
580             'resources/chromoting.ico',
581             '<(PRODUCT_DIR)/icudtl.dat',
582           ],
583           'generated_files_dst': [
584             '<@(_compiled_inputs_dst)',
585             'files/sas.dll',
586             'files/com.google.chrome.remote_assistance.json',
587             'files/com.google.chrome.remote_desktop.json',
588             'files/chromoting.ico',
589             'files/icudtl.dat',
590           ],
591           'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
592           'outputs': [
593             '<(_zip_path)',
594           ],
595           'actions': [
596             {
597               'action_name': 'Zip installer files for signing',
598               'temp_dir': '<(INTERMEDIATE_DIR)/installation',
599               'source_files': [
600                 '<@(remoting_host_installer_win_files)',
601               ],
602               'inputs': [
603                 '<@(_compiled_inputs)',
604                 '<(sas_dll_path)/sas.dll',
605                 '<@(_source_files)',
606                 'host/installer/build-installer-archive.py',
607                 'resources/chromoting.ico',
608               ],
609               'outputs': [
610                 '<(_zip_path)',
611               ],
612               'action': [
613                 'python', 'host/installer/build-installer-archive.py',
614                 '<(_temp_dir)',
615                 '<(_zip_path)',
616                 '--source-file-roots', '<@(remoting_host_installer_win_roots)',
617                 '--source-files', '<@(_source_files)',
618                 '--generated-files', '<@(_generated_files)',
619                 '--generated-files-dst', '<@(_generated_files_dst)',
620                 '--defs', '<@(_defs)',
621               ],
622             },
623           ],  # actions
624         }, # end of target 'remoting_me2me_host_archive'
625       ],  # end of 'targets'
626     }, {
627       # Dummy targets for when Wix is not available.
628       'targets': [
629         {
630           'target_name': 'remoting_host_installation',
631           'type': 'none',
632         },
634         {
635           'target_name': 'remoting_me2me_host_archive',
636           'type': 'none',
637         },
638       ],  # end of 'targets'
639     }],  # 'wix_exists == "True" and sas_dll_exists == "True"'
641   ],  # end of 'conditions'