Skip to content

Commit

Permalink
Move //remoting/remoting_host_win.gypi:* to GN
Browse files Browse the repository at this point in the history
BUG=512899

Review URL: https://codereview.chromium.org/1749053002

Cr-Commit-Position: refs/heads/master@{#380425}
  • Loading branch information
zijiehe authored and Commit bot committed Mar 10, 2016
1 parent 3dc0396 commit ed559bd
Show file tree
Hide file tree
Showing 7 changed files with 398 additions and 51 deletions.
11 changes: 7 additions & 4 deletions remoting/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ group("remoting_all") {

if (is_win) {
deps += [
#"//remoting:remoting_breakpad_tester",
#"//remoting:remoting_console",
#"//remoting:remoting_desktop",
#"//remoting:remoting_host_installation",
"//remoting:remoting_breakpad_tester",
"//remoting/host:remoting_console",
"//remoting/host:remoting_desktop",

# "//remoting:remoting_host_installation",
]
}

Expand Down Expand Up @@ -83,6 +84,8 @@ if (is_win) {
"//remoting/host",
]

configs += [ "//build/config/compiler:wexit_time_destructors" ]

sources = [
"tools/breakpad_tester_win.cc",
]
Expand Down
317 changes: 311 additions & 6 deletions remoting/host/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/util/version.gni")
import("//remoting/remoting_host.gni")
import("//remoting/remoting_enable.gni")
import("//remoting/remoting_locales.gni")
import("//remoting/remoting_options.gni")
import("//remoting/remoting_srcs.gni")
Expand Down Expand Up @@ -369,6 +369,40 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host.
]
}

# GYP version: remoting/remoting_host_win.gypi:remoting_lib_ps
static_library("remoting_lib_ps") {
defines = [
"ENTRY_PREFIX=Ps",
"REGISTER_PROXY_DLL",
]

deps = [
":remoting_lib_idl",
]

sources = [
"$root_gen_dir/remoting/host/chromoting_lib.dlldata.c",
"$root_gen_dir/remoting/host/chromoting_lib_p.c",
]

if (is_clang) {
cflags = [
# MIDL generated code has a habit of omitting optional braces.
"-Wno-missing-braces",

# Source files generated by the MIDL compiler trigger warnings with
# -Wincompatible-pointer-types enabled.
"-Wno-incompatible-pointer-types",

# Generated code contains unused variables.
"-Wno-unused-variable",

# PROXYFILE_LIST_START is an extern with initializer.
"-Wno-extern-initializer",
]
}
}

# Makes the .mc file from the .mc.jinja file.
remoting_localize("messages_localizing") {
sources = [
Expand Down Expand Up @@ -396,6 +430,237 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host.
]
}

# GYP version: remoting/remoting_host_win.gypi:remoting_console
executable("remoting_console") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

defines = [ "BINARY=BINARY_HOST_ME2ME" ]

deps = [
":remoting_core",
":remoting_windows_resources",
]

sources = [
"$root_gen_dir/remoting/version.rc",
"win/entry_point.cc",
]

ldflags = [
"/MANIFEST:EMBED",
"/MANIFESTINPUT:" +
rebase_path("win/dpi_aware.manifest", root_build_dir),
"/ENTRY:HostEntryPoint",
"/NODEFAULTLIB",
]
}

# GYP version: //remoting/remoting_host_win.gypi:remoting_core
shared_library("remoting_core") {
configs += [
"//base/allocator:allocator_shim_define",
"//build/config/compiler:wexit_time_destructors",
]

defines = [
"_ATL_APARTMENT_THREADED",
"_ATL_CSTRING_EXPLICIT_CONSTRUCTORS",
"_ATL_NO_AUTOMATIC_NAMESPACE",
"_ATL_NO_EXCEPTIONS",
"BINARY=BINARY_CORE",
"BINARY_CORE=1",
"BINARY_DESKTOP=2",
"BINARY_HOST_ME2ME=3",
"BINARY_NATIVE_MESSAGING_HOST=4",
"BINARY_REMOTE_ASSISTANCE_HOST=5",
"DAEMON_CONTROLLER_CLSID=\"$daemon_controller_clsid\"",
"RDP_DESKTOP_SESSION_CLSID=\"$rdp_desktop_session_clsid\"",
"HOST_IMPLEMENTATION",
"ISOLATION_AWARE_ENABLED=1",
"STRICT",
"VERSION=$chrome_version_full",
]

if (is_win && remoting_multi_process != 0 && remoting_rdp_session != 0) {
defines += [ "REMOTING_RDP_SESSION" ]
}

if (remoting_multi_process != 0) {
defines += [ "REMOTING_MULTI_PROCESS" ]
}

deps = [
":remoting_lib_idl",
":remoting_lib_ps",
":remoting_me2me_host_static",
":remoting_windows_resources",
"//base",
"//base:base_static",
"//base/third_party/dynamic_annotations",
"//ipc",
"//net",
"//remoting/base",
"//remoting/base:breakpad",
"//remoting/codec",
"//remoting/host",
"//remoting/host:messages",
"//remoting/host/it2me:common",
"//remoting/host/native_messaging",
"//remoting/host/setup",
"//remoting/protocol",
"//sandbox/win:sandbox", # Should always use Windows version
"//third_party/webrtc/modules/desktop_capture",
]

sources = [
"desktop_process_main.cc",
"host_main.cc",
"host_main.h",
"it2me/it2me_native_messaging_host_main.cc",
"it2me/it2me_native_messaging_host_main.h",
"security_key/remote_security_key_main.cc",
"security_key/remote_security_key_main.h",
"setup/me2me_native_messaging_host_main.cc",
"setup/me2me_native_messaging_host_main.h",
"win/chromoting_lib.rc",
"win/chromoting_module.cc",
"win/chromoting_module.h",
"win/core.cc",
"win/core_resource.h",
"win/host_service.cc",
"win/host_service.h",
"win/omaha.cc",
"win/omaha.h",
"win/rdp_desktop_session.cc",
"win/rdp_desktop_session.h",
"win/unprivileged_process_delegate.cc",
"win/unprivileged_process_delegate.h",
"win/wts_session_process_delegate.cc",
"win/wts_session_process_delegate.h",
"worker_process_ipc_delegate.h",
]

ldflags = [
"/MANIFEST:EMBED",
"/MANIFESTINPUT:" +
rebase_path("win/common-controls.manifest", root_build_dir),
"comctl32.lib",
"rpcns4.lib",
"rpcrt4.lib",
"uuid.lib",
"wtsapi32.lib",
"/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE",
"/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE",
"/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE",
"/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE",
]

if (is_clang) {
cflags += [ "-Wno-header-hygiene" ]
}
}

# GYP version: //remoting/remoting_host_win.gypi:remoting_desktop
executable("remoting_desktop") {
configs += [
"//build/config/compiler:wexit_time_destructors",
"//build/config/win:windowed",
]

defines = [ "BINARY=BINARY_DESKTOP" ]

deps = [
":remoting_core",
":remoting_windows_resources",
]

sources = [
"$root_gen_dir/remoting/version.rc",
"win/entry_point.cc",
]

ldflags = [
"/MANIFEST:EMBED",
"/MANIFESTINPUT:" +
rebase_path("win/dpi_aware.manifest", root_build_dir),
"/MANIFESTUAC",
"/ENTRY:HostEntryPoint",
"/NODEFAULTLIB",
]

if (is_official_build) {
ldflags += [
"/MANIFESTUAC:level=2",
"/MANIFESTUAC:uiAccess=true",
]
}
}

# GYP version: //remoting/remoting_host_win.gypi:remote_security_key
executable("remote_security_key") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

defines = [ "BINARY=BINARY_REMOTE_SECURITY_KEY" ]

deps = [
":remoting_core",
":remoting_windows_resources",
]

sources = [
"$root_gen_dir/remoting/version.rc",
"security_key/remote_security_key_entry_point.cc",
]

ldflags = [ "/NODEFAULTLIB" ]
}

# GYP version:
# //remoting/remoting_host_win.gypi:remoting_me2me_native_messaging_host
executable("remoting_me2me_native_messaging_host") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

deps = [
":remoting_core",
":remoting_windows_resources",
]

sources = [
"$root_gen_dir/remoting/version.rc",
"setup/me2me_native_messaging_host_entry_point.cc",
]

ldflags = [ "/NODEFAULTLIB" ]
}

# GYP version: //remoting/remoting_host_win.gypi:remoting_windows_resources
remoting_localize("remoting_windows_resources") {
deps = [
"//remoting/resources",
]

sources = [
"win/core.rc.jinja2",
"win/version.rc.jinja2",
]

# TODO(zijiehe): Export lastchange_path from
# //chrome/version.gni:process_version
variables = [
rebase_path(chrome_version_file),
rebase_path(remoting_version_file),
rebase_path("//build/util/LASTCHANGE"),
]

output = "$root_gen_dir/remoting/{{source_name_part}}"

locale_dir = webapp_locale_dir

encoding = "utf-16"

locales = remoting_locales
}

# TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
}

Expand All @@ -420,8 +685,6 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host.
action_foreach("remoting_native_messaging_manifests") {
if (is_mac) {
assert(false, "not implemented on mac yet")
} else if (is_win) {
assert(false, "not implemented on win yet")
} else {
me2me_host_path =
"/opt/google/chrome-remote-desktop/native-messaging-host"
Expand Down Expand Up @@ -505,15 +768,57 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host.
sources += [ "internal/internal_mac-inl.h" ]
defines += [ "USE_REMOTING_MACOSX_INTERNAL" ]
}

if (is_win && remoting_multi_process != 0 && remoting_rdp_session != 0) {
defines += [ "REMOTING_RDP_SESSION" ]
}

if (remoting_multi_process != 0) {
defines += [ "REMOTING_MULTI_PROCESS" ]
}
}

if (!is_win) {
if (is_win) {
# GYP version: //remoting/remoting_host_win.gypi:remoting_me2me_host
executable("remoting_me2me_host") {
configs += [
"//build/config/compiler:wexit_time_destructors",
"//build/config/win:windowed",
]

defines = [ "BINARY=BINARY_HOST_ME2ME" ]

deps = [
":remoting_core",
":remoting_windows_resources",
]

sources = [
"$root_gen_dir/remoting/version.rc",
"win/entry_point.cc",
]

output_name = "remoting_host"

ldflags = [
"/MANIFEST:EMBED",
"/MANIFESTINPUT:" +
rebase_path("win/dpi_aware.manifest", root_build_dir),
"/ENTRY:HostEntryPoint",
"/NODEFAULTLIB",
]
}
} else {
executable("remoting_me2me_host") {
sources = [
"host_main.cc",
"host_main.h",
]

if (is_mac && is_chrome_branded && is_official_build) {
defines = [ "REMOTING_ENABLE_BREAKPAD" ]
}

deps = [
":credits",
":remoting_me2me_host_static",
Expand Down Expand Up @@ -546,8 +851,8 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host.
"$remoting_version_patch" + "." + "$chrome_version_build" +
"." + "$chrome_version_patch" ]

if (is_mac || is_win) {
assert(false, "not implemented on mac or win yet")
if (is_mac) {
assert(false, "not implemented on mac yet")
}
}
}
Expand Down
Loading

0 comments on commit ed559bd

Please sign in to comment.