# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, 'variables': { 'conditions': [ # Enable the multi-process host on Windows by default. ['OS=="win"', { 'remoting_multi_process%': 1, }, { 'remoting_multi_process%': 0, }], ], }, 'remoting_multi_process%': '<(remoting_multi_process)', 'remoting_rdp_session%': 1, 'remoting_localize_path': 'tools/build/remoting_localize.py', 'branding_path': '../remoting/branding_<(branding)', 'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales', 'host_plugin_mime_type': 'application/vnd.chromium.remoting-host', 'conditions': [ # Remoting host is supported only on Windows, OSX and Linux (with X11). ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0 and use_x11==1)', { 'enable_remoting_host': 1, }, { 'enable_remoting_host': 0, }], ['OS=="mac"', { 'mac_bundle_id': ' <@(_outputs)', ], 'message': 'Generating <@(_outputs)', }, ], }, # end of target 'remoting_lib_rc' # The only difference between |remoting_console.exe| and # |remoting_host.exe| is that the former is a console application. # |remoting_console.exe| is used for debugging purposes. { 'target_name': 'remoting_console', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines': [ 'BINARY=BINARY_HOST_ME2ME', ], 'dependencies': [ 'remoting_core', 'remoting_windows_resources', ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc', 'host/win/entry_point.cc', ], 'msvs_settings': { 'VCManifestTool': { 'AdditionalManifestFiles': [ 'host/win/dpi_aware.manifest', ], }, 'VCLinkerTool': { 'EntryPointSymbol': 'HostEntryPoint', 'IgnoreAllDefaultLibraries': 'true', 'SubSystem': '1', # /SUBSYSTEM:CONSOLE }, }, }, # end of target 'remoting_console' { 'target_name': 'remoting_core', 'type': 'shared_library', 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines' : [ '_ATL_APARTMENT_THREADED', '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS', '_ATL_NO_AUTOMATIC_NAMESPACE', '_ATL_NO_EXCEPTIONS', 'BINARY=BINARY_CORE', 'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"', 'RDP_DESKTOP_SESSION_CLSID="{<(rdp_desktop_session_clsid)}"', 'HOST_IMPLEMENTATION', 'ISOLATION_AWARE_ENABLED=1', 'STRICT', 'VERSION=<(version_full)', ], 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:base_static', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../ipc/ipc.gyp:ipc', '../net/net.gyp:net', '../third_party/webrtc/modules/modules.gyp:desktop_capture', 'remoting_base', 'remoting_breakpad', 'remoting_host', 'remoting_host_setup_base', 'remoting_lib_idl', 'remoting_lib_ps', 'remoting_lib_rc', 'remoting_me2me_host_static', 'remoting_native_messaging_base', 'remoting_protocol', 'remoting_windows_resources', ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc', '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc', '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc', '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc', 'host/desktop_process_main.cc', 'host/host_main.cc', 'host/host_main.h', 'host/ipc_constants.cc', 'host/ipc_constants.h', 'host/remoting_me2me_host.cc', 'host/sas_injector.h', 'host/sas_injector_win.cc', 'host/setup/me2me_native_messaging_host_main.cc', 'host/verify_config_window_win.cc', 'host/verify_config_window_win.h', 'host/win/chromoting_module.cc', 'host/win/chromoting_module.h', 'host/win/core.cc', 'host/win/core_resource.h', 'host/win/elevated_controller.cc', 'host/win/elevated_controller.h', 'host/win/host_service.cc', 'host/win/host_service.h', 'host/win/omaha.cc', 'host/win/omaha.h', 'host/win/rdp_desktop_session.cc', 'host/win/rdp_desktop_session.h', 'host/win/unprivileged_process_delegate.cc', 'host/win/unprivileged_process_delegate.h', 'host/win/worker_process_launcher.cc', 'host/win/worker_process_launcher.h', 'host/win/wts_session_process_delegate.cc', 'host/win/wts_session_process_delegate.h', 'host/worker_process_ipc_delegate.h', ], 'msvs_settings': { 'VCManifestTool': { 'EmbedManifest': 'true', 'AdditionalManifestFiles': [ 'host/win/common-controls.manifest', ], }, 'VCLinkerTool': { 'AdditionalDependencies': [ 'comctl32.lib', 'rpcns4.lib', 'rpcrt4.lib', 'uuid.lib', 'wtsapi32.lib', ], 'AdditionalOptions': [ # Export the proxy/stub entry points. Note that the generated # routines have 'Ps' prefix to avoid conflicts with our own # DllMain(). '/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE', '/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE', '/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE', '/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE', ], }, }, }, # end of target 'remoting_core' { 'target_name': 'remoting_desktop', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines': [ 'BINARY=BINARY_DESKTOP', ], 'dependencies': [ 'remoting_core', 'remoting_windows_resources', ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc', 'host/win/entry_point.cc', ], 'msvs_settings': { 'VCManifestTool': { 'AdditionalManifestFiles': [ 'host/win/dpi_aware.manifest', ], }, 'VCLinkerTool': { 'EnableUAC': 'true', # Add 'level="requireAdministrator" uiAccess="true"' to # the manifest only for the official builds because it requires # the binary to be signed to work. 'conditions': [ ['buildtype == "Official"', { 'UACExecutionLevel': 2, 'UACUIAccess': 'true', }], ], 'EntryPointSymbol': 'HostEntryPoint', 'IgnoreAllDefaultLibraries': 'true', 'SubSystem': '2', # /SUBSYSTEM:WINDOWS }, }, }, # end of target 'remoting_desktop' { 'target_name': 'remoting_host_exe', 'product_name': 'remoting_host', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines': [ 'BINARY=BINARY_HOST_ME2ME', ], 'dependencies': [ 'remoting_core', 'remoting_windows_resources', ], 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc', 'host/win/entry_point.cc', ], 'msvs_settings': { 'VCManifestTool': { 'AdditionalManifestFiles': [ 'host/win/dpi_aware.manifest', ], }, 'VCLinkerTool': { 'EntryPointSymbol': 'HostEntryPoint', 'IgnoreAllDefaultLibraries': 'true', 'ImportLibrary': '$(OutDir)\\lib\\remoting_host_exe.lib', 'OutputFile': '$(OutDir)\\remoting_host.exe', 'SubSystem': '2', # /SUBSYSTEM:WINDOWS }, }, }, # end of target 'remoting_host_exe' { 'target_name': 'remoting_host_messages', 'type': 'none', 'dependencies': [ 'remoting_resources', ], 'hard_dependency': 1, 'direct_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', ], }, 'sources': [ 'host/win/host_messages.mc.jinja2' ], 'rules': [ { 'rule_name': 'localize', 'extension': 'jinja2', 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.mc', ], 'action': [ 'python', '<(remoting_localize_path)', '--locale_dir', '<(webapp_locale_dir)', '--template', '<(RULE_INPUT_PATH)', '--output', '<@(_outputs)', '--encoding', 'utf-16', '<@(remoting_locales)', ], 'message': 'Localizing the event log messages' }, ], }, # end of target 'remoting_host_messages' # Generates localized resources for the Windows binaries. # The substitution strings are taken from: # - build/util/LASTCHANGE - the last source code revision. # - chrome/VERSION - the major, build & patch versions. # - remoting/VERSION - the chromoting patch version (and overrides # for chrome/VERSION). # - translated webapp strings { 'target_name': 'remoting_windows_resources', 'type': 'none', 'dependencies': [ 'remoting_resources', ], 'hard_dependency': 1, 'direct_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', ], }, 'sources': [ 'host/win/core.rc.jinja2', 'host/win/version.rc.jinja2', ], 'rules': [ { 'rule_name': 'version', 'extension': 'jinja2', 'variables': { 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE', }, 'inputs': [ '<(chrome_version_path)', '<(lastchange_path)', '<(remoting_version_path)', '<(RULE_INPUT_PATH)', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/<(RULE_INPUT_ROOT)', ], 'action': [ 'python', '<(remoting_localize_path)', '--variables', '<(chrome_version_path)', # |remoting_version_path| must be after |chrome_version_path| # because it can contain overrides for the version numbers. '--variables', '<(remoting_version_path)', '--variables', '<(lastchange_path)', '--locale_dir', '<(webapp_locale_dir)', '--template', '<(RULE_INPUT_PATH)', '--output', '<@(_outputs)', '--encoding', 'utf-16', '<@(remoting_locales)', ], 'message': 'Localizing the version information' }, ], }, # end of target 'remoting_windows_resources' ], # end of 'targets' }], # 'OS=="win"' # The host installation is generated only if WiX is available. If # component build is used the produced installation will not work due to # missing DLLs. We build it anyway to make sure the GYP scripts are executed # by the bots. ['OS == "win" and wix_exists == "True" and sas_dll_exists == "True"', { 'targets': [ { 'target_name': 'remoting_host_installation', 'type': 'none', 'dependencies': [ 'remoting_me2me_host_archive', ], 'sources': [ '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip', ], 'outputs': [ '<(PRODUCT_DIR)/chromoting.msi', ], 'rules': [ { 'rule_name': 'zip2msi', 'extension': 'zip', 'inputs': [ 'tools/zip2msi.py', ], 'outputs': [ '<(PRODUCT_DIR)/chromoting.msi', ], 'action': [ 'python', 'tools/zip2msi.py', '--wix_path', '<(wix_path)', '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation', '<(RULE_INPUT_PATH)', '<@(_outputs)', ], 'message': 'Generating <@(_outputs)', }, ], }, # end of target 'remoting_host_installation' { 'target_name': 'remoting_me2me_host_archive', 'type': 'none', 'dependencies': [ '<(icu_gyp_path):icudata', 'remoting_core', 'remoting_desktop', 'remoting_host_exe', 'remoting_native_messaging_manifests', ], 'compiled_inputs': [ '<(PRODUCT_DIR)/remoting_core.dll', '<(PRODUCT_DIR)/remoting_desktop.exe', '<(PRODUCT_DIR)/remoting_host.exe', ], 'compiled_inputs_dst': [ 'files/remoting_core.dll', 'files/remoting_desktop.exe', 'files/remoting_host.exe', ], 'conditions': [ ['buildtype == "Official"', { 'defs': [ 'OFFICIAL_BUILD=1', ], }, { # else buildtype != "Official" 'defs': [ 'OFFICIAL_BUILD=0', ], }], ], 'defs': [ 'BRANDING=<(branding)', 'DAEMON_CONTROLLER_CLSID={<(daemon_controller_clsid)}', 'RDP_DESKTOP_SESSION_CLSID={<(rdp_desktop_session_clsid)}', 'VERSION=<(version_full)', ], 'generated_files': [ '<@(_compiled_inputs)', '<(sas_dll_path)/sas.dll', '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json', 'resources/chromoting.ico', '<(PRODUCT_DIR)/icudtl.dat', ], 'generated_files_dst': [ '<@(_compiled_inputs_dst)', 'files/sas.dll', 'files/com.google.chrome.remote_desktop.json', 'files/chromoting.ico', 'files/icudtl.dat', ], 'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip', 'outputs': [ '<(_zip_path)', ], 'actions': [ { 'action_name': 'Zip installer files for signing', 'temp_dir': '<(INTERMEDIATE_DIR)/installation', 'source_files': [ '<@(remoting_host_installer_win_files)', ], 'inputs': [ '<@(_compiled_inputs)', '<(sas_dll_path)/sas.dll', '<@(_source_files)', 'host/installer/build-installer-archive.py', 'resources/chromoting.ico', ], 'outputs': [ '<(_zip_path)', ], 'action': [ 'python', 'host/installer/build-installer-archive.py', '<(_temp_dir)', '<(_zip_path)', '--source-file-roots', '<@(remoting_host_installer_win_roots)', '--source-files', '<@(_source_files)', '--generated-files', '<@(_generated_files)', '--generated-files-dst', '<@(_generated_files_dst)', '--defs', '<@(_defs)', ], }, ], # actions }, # end of target 'remoting_me2me_host_archive' ], # end of 'targets' }], # '<(wix_path) != ""' ], # end of 'conditions' 'targets': [ { 'target_name': 'remoting_breakpad', 'type': 'static_library', 'variables': { 'enable_wexit_time_destructors': 1, }, 'dependencies': [ '../base/base.gyp:base', ], 'sources': [ 'base/breakpad.h', 'base/breakpad_linux.cc', 'base/breakpad_mac.mm', 'base/breakpad_win.cc', ], 'conditions': [ ['OS=="mac"', { 'dependencies': [ '../breakpad/breakpad.gyp:breakpad', ], }], ['OS=="win"', { 'dependencies': [ '../breakpad/breakpad.gyp:breakpad_handler', ], }], ], }, # end of target 'remoting_breakpad' { 'target_name': 'remoting_client_plugin', 'type': 'static_library', 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines': [ 'HAVE_STDINT_H', # Required by on2_integer.h ], 'dependencies': [ '../net/net.gyp:net', '../ppapi/ppapi.gyp:ppapi_cpp_objects', '../third_party/webrtc/modules/modules.gyp:desktop_capture', '../ui/events/events.gyp:dom4_keycode_converter', 'remoting_base', 'remoting_client', 'remoting_protocol', ], 'sources': [ 'client/plugin/chromoting_instance.cc', 'client/plugin/chromoting_instance.h', 'client/plugin/delegating_signal_strategy.cc', 'client/plugin/delegating_signal_strategy.h', 'client/plugin/normalizing_input_filter.cc', 'client/plugin/normalizing_input_filter.h', 'client/plugin/normalizing_input_filter_cros.cc', 'client/plugin/normalizing_input_filter_mac.cc', 'client/plugin/pepper_audio_player.cc', 'client/plugin/pepper_audio_player.h', 'client/plugin/pepper_entrypoints.cc', 'client/plugin/pepper_entrypoints.h', 'client/plugin/pepper_input_handler.cc', 'client/plugin/pepper_input_handler.h', 'client/plugin/pepper_network_manager.cc', 'client/plugin/pepper_network_manager.h', 'client/plugin/pepper_packet_socket_factory.cc', 'client/plugin/pepper_packet_socket_factory.h', 'client/plugin/pepper_plugin_thread_delegate.cc', 'client/plugin/pepper_plugin_thread_delegate.h', 'client/plugin/pepper_port_allocator.cc', 'client/plugin/pepper_port_allocator.h', 'client/plugin/pepper_token_fetcher.cc', 'client/plugin/pepper_token_fetcher.h', 'client/plugin/pepper_util.cc', 'client/plugin/pepper_util.h', 'client/plugin/pepper_view.cc', 'client/plugin/pepper_view.h', ], 'conditions' : [ [ 'chromeos==0', { 'sources!': [ 'client/plugin/normalizing_input_filter_cros.cc', ], }], ], }, # end of target 'remoting_client_plugin' { 'target_name': 'remoting_webapp', 'type': 'none', 'variables': { 'remoting_webapp_patch_files': [ 'webapp/appsv2.patch', ], 'remoting_webapp_apps_v2_js_files': [ 'webapp/background.js', ], }, 'dependencies': [ 'remoting_resources', 'remoting_host_plugin', ], 'locale_files': [ '<@(remoting_webapp_locale_files)', ], 'conditions': [ ['enable_remoting_host==1', { 'locale_files': [ '<@(remoting_locale_files)', ], 'variables': { 'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)', }, }, { 'variables': { 'plugin_path': '', }, 'dependencies!': [ 'remoting_host_plugin', ], }], ], 'actions': [ { 'action_name': 'Build Remoting WebApp', 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp', 'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip', 'inputs': [ 'webapp/build-webapp.py', '<(chrome_version_path)', '<(remoting_version_path)', '<@(remoting_webapp_files)', '<@(_locale_files)', ], 'conditions': [ ['enable_remoting_host==1', { 'inputs': [ '<(plugin_path)', ], }], ], 'outputs': [ '<(_output_dir)', '<(_zip_path)', ], 'action': [ 'python', 'webapp/build-webapp.py', '<(buildtype)', '<(version_full)', '<(host_plugin_mime_type)', '<(_output_dir)', '<(_zip_path)', '<(plugin_path)', '<@(remoting_webapp_files)', '--locales', '<@(_locale_files)', ], }, ], 'target_conditions': [ # We cannot currently build the appsv2 version of WebApp on Windows as # there isn't a version of the "patch" tool available on windows. We # should remove this condition when we remove the reliance on patch. # We define this in a 'target_conditions' section because 'plugin_path' # is defined in a 'conditions' section so its value is not available # when gyp processes the 'actions' in a 'conditions" section. ['OS != "win"', { 'actions': [ { 'action_name': 'Build Remoting WebApp V2', 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2', 'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2.zip', 'inputs': [ 'webapp/build-webapp.py', '<(chrome_version_path)', '<(remoting_version_path)', '<@(remoting_webapp_apps_v2_js_files)', '<@(remoting_webapp_files)', '<@(remoting_webapp_locale_files)', '<@(remoting_webapp_patch_files)', ], 'conditions': [ ['enable_remoting_host==1', { 'inputs': [ '<(plugin_path)', ], }], ], 'outputs': [ '<(_output_dir)', '<(_zip_path)', ], 'action': [ 'python', 'webapp/build-webapp.py', '<(buildtype)', '<(version_full)', '<(host_plugin_mime_type)', '<(_output_dir)', '<(_zip_path)', '<(plugin_path)', '<@(remoting_webapp_apps_v2_js_files)', '<@(remoting_webapp_files)', '--locales', '<@(remoting_webapp_locale_files)', '--patches', '<@(remoting_webapp_patch_files)', ], }, ], }], ], }, # end of target 'remoting_webapp' { 'target_name': 'remoting_resources', 'type': 'none', 'variables': { 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)', 'grit_resource_ids': 'resources/resource_ids', 'sources': [ 'base/resources_unittest.cc', 'host/continue_window_mac.mm', 'host/disconnect_window_mac.mm', 'host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2', 'host/mac/me2me_preference_pane-InfoPlist.strings.jinja2', 'host/plugin/host_plugin-InfoPlist.strings.jinja2', 'host/win/core.rc.jinja2', 'host/win/host_messages.mc.jinja2', 'host/win/version.rc.jinja2', 'webapp/background.js', 'webapp/butter_bar.js', 'webapp/client_screen.js', 'webapp/error.js', 'webapp/host_list.js', 'webapp/host_setup_dialog.js', 'webapp/host_table_entry.js', 'webapp/main.html', 'webapp/manifest.json', 'webapp/paired_client_manager.js', 'webapp/remoting.js', ], }, 'actions': [ { 'action_name': 'verify_resources', 'inputs': [ 'resources/remoting_strings.grd', 'tools/verify_resources.py', '<@(sources)' ], 'outputs': [ '<(PRODUCT_DIR)/remoting_resources_verified.stamp', ], 'action': [ 'python', 'tools/verify_resources.py', '-t', '<(PRODUCT_DIR)/remoting_resources_verified.stamp', '-r', 'resources/remoting_strings.grd', '<@(sources)', ], }, { 'action_name': 'remoting_strings', 'variables': { 'grit_grd_file': 'resources/remoting_strings.grd', }, 'includes': [ '../build/grit_action.gypi' ], }, { 'action_name': 'copy_locales', 'variables': { 'copy_output_dir%': '<(PRODUCT_DIR)', }, 'inputs': [ 'tools/build/remoting_copy_locales.py', '