Commit bc422601 authored by Brett Wilson's avatar Brett Wilson

Fix remoting GN Mac build.

TBR=dpranke

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

Cr-Commit-Position: refs/heads/master@{#319090}
parent 4596b516
...@@ -59,9 +59,10 @@ source_set("test_support") { ...@@ -59,9 +59,10 @@ source_set("test_support") {
} }
} }
# TODO(GYP) remoting_unittests on Windows. Currently this fails with a # TODO(GYP) remoting_unittests on Mac/Windows. Currently this fails with a
# duplicate resource error on linking. # duplicate resource error on linking on Windows. Just needs to be checked on
if (!is_win) { # Mac.
if (!is_win && !is_mac) {
test("remoting_unittests") { test("remoting_unittests") {
# Sources not included in one of the more specific unit_tests deps. # Sources not included in one of the more specific unit_tests deps.
sources = [ sources = [
......
...@@ -9,322 +9,332 @@ import("//remoting/remoting_srcs.gni") ...@@ -9,322 +9,332 @@ import("//remoting/remoting_srcs.gni")
import("//remoting/remoting_version.gni") import("//remoting/remoting_version.gni")
import("//remoting/tools/build/remoting_localize.gni") import("//remoting/tools/build/remoting_localize.gni")
# This must be a static library instead of a source set because if (is_mac) { # TODO(GYP) Mac build of remoting host.
# remoting_unittests requires that remoting_me2me_host.cc not be pulled in, group("host") {
# which in turn depends on remoting_me2me_host_static which isn't part of that
# build.
#
# TODO fix this, successful builds should not depend on static libraries
# stripping code.
static_library("host") {
sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
".",
"//remoting")
libs = []
configs += [ "//build/config/compiler:wexit_time_destructors" ]
defines = [ "WEBRTC_CHROMIUM_BUILD" ]
deps = [
"//base:i18n",
"//components/policy:policy",
"//components/policy:policy_component_common",
"//crypto",
"//google_apis",
"//ipc",
"//remoting/base",
"//remoting/protocol",
"//remoting/resources",
"//ui/events/platform",
"//ui/events:dom4_keycode_converter",
]
if (is_linux && !is_chromeos) {
libs += [ "pam" ]
} }
group("test_support") {
if (use_x11) { }
configs += [ group("unit_tests") {
"//build/config/linux:x11",
"//build/config/linux:xrandr",
]
if (!is_chromeos) {
deps += [ "//build/config/linux/gtk" ]
}
} else {
sources -= [
"clipboard_x11.cc",
"input_injector_x11.cc",
"local_input_monitor_x11.cc",
]
if (is_linux) {
# These will already be filtered out on non-Linux.
sources -= [
"linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h",
]
}
} }
} else {
# This must be a static library instead of a source set because
# remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
# which in turn depends on remoting_me2me_host_static which isn't part of that
# build.
#
# TODO fix this, successful builds should not depend on static libraries
# stripping code.
static_library("host") {
sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
".",
"//remoting")
if (is_chromeos) { libs = []
deps += [
"//cc",
"//ppapi/host",
"//skia",
"//ui/aura",
"//ui/compositor",
"//ui/events",
"//ui/views",
]
if (use_ash) { configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps += [ "//ash" ]
} defines = [ "WEBRTC_CHROMIUM_BUILD" ]
deps = [
"//base:i18n",
"//components/policy:policy",
"//components/policy:policy_component_common",
"//crypto",
"//google_apis",
"//ipc",
"//remoting/base",
"//remoting/protocol",
"//remoting/resources",
"//ui/events/platform",
"//ui/events:dom4_keycode_converter",
]
if (!use_x11) { if (is_linux && !is_chromeos) {
sources -= [ "input_injector_x11.cc" ] libs += [ "pam" ]
} }
if (use_ozone) { if (use_x11) {
deps += [ "//ui/ozone" ] configs += [
"//build/config/linux:x11",
"//build/config/linux:xrandr",
]
if (!is_chromeos) {
deps += [ "//build/config/linux/gtk" ]
}
} else { } else {
sources -= [ sources -= [
"clipboard_x11.cc", "clipboard_x11.cc",
"input_injector_chromeos.cc", "input_injector_x11.cc",
"input_injector_chromeos.h",
"linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h",
"local_input_monitor_x11.cc", "local_input_monitor_x11.cc",
] ]
if (is_linux) {
# These will already be filtered out on non-Linux.
sources -= [
"linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h",
]
}
} }
sources -= [ if (is_chromeos) {
"continue_window_linux.cc", deps += [
"disconnect_window_linux.cc", "//cc",
] "//ppapi/host",
} "//skia",
"//ui/aura",
"//ui/compositor",
"//ui/events",
"//ui/views",
]
if (is_mac) { if (use_ash) {
# TODO(GYP) Mac host_bundle_name and prefpane_bundle_name. deps += [ "//ash" ]
# Note if you are looking at this: It really sucks to have to synchronously }
# call into python twice to get these values. They should instead be
# written into a generated header via the process_version template, and we if (!use_x11) {
# change the source files to include that header rather than rely on these sources -= [ "input_injector_x11.cc" ]
# defines being set in the build. }
#defines += [
# "HOST_BUNDLE_NAME=\"$host_bundle_name\"", if (use_ozone) {
# "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"", deps += [ "//ui/ozone" ]
#] } else {
sources -= [
libs += [ "clipboard_x11.cc",
"Accelerate.framework", "input_injector_chromeos.cc",
"libpam.a", "input_injector_chromeos.h",
] "linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h",
"local_input_monitor_x11.cc",
]
}
deps += [ "//google_toolbox_for_mac" ] sources -= [
} "continue_window_linux.cc",
"disconnect_window_linux.cc",
]
}
if (is_win) { if (is_mac) {
deps += [ # TODO(GYP) Mac host_bundle_name and prefpane_bundle_name.
":messages", # Note if you are looking at this: It really sucks to have to synchronously
":remoting_lib_idl", # call into python twice to get these values. They should instead be
] # written into a generated header via the process_version template, and we
} # change the source files to include that header rather than rely on these
# defines being set in the build.
#defines += [
# "HOST_BUNDLE_NAME=\"$host_bundle_name\"",
# "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"",
#]
libs += [
"Accelerate.framework",
"libpam.a",
]
if (enable_webrtc) { deps += [ "//third_party/google_toolbox_for_mac" ]
deps += [ }
"//third_party/libjingle:libpeerconnection",
"//third_party/webrtc/modules/desktop_capture",
]
sources += rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources, if (is_win) {
".", deps += [
"//remoting") ":messages",
} ":remoting_lib_idl",
} ]
}
source_set("test_support") { if (enable_webrtc) {
testonly = true deps += [
"//third_party/libjingle:libpeerconnection",
sources = [ "//third_party/webrtc/modules/desktop_capture",
"fake_desktop_capturer.cc", ]
"fake_desktop_capturer.h",
"fake_desktop_environment.cc",
"fake_desktop_environment.h",
"fake_host_extension.cc",
"fake_host_extension.h",
"fake_host_status_monitor.h",
"fake_host_status_monitor.h",
"fake_mouse_cursor_monitor.cc",
"fake_mouse_cursor_monitor.h",
]
deps = [
"//remoting/proto",
"//testing/gtest",
]
public_deps = [
":host",
]
if (enable_webrtc) {
public_deps += [
"//third_party/libjingle:libpeerconnection",
"//third_party/webrtc/modules/desktop_capture",
]
}
}
# The host portions of the remoting unit tests. sources +=
source_set("unit_tests") { rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources,
testonly = true ".",
"//remoting")
sources = [ }
"audio_pump_unittest.cc",
"audio_silence_detector_unittest.cc",
"capture_scheduler_unittest.cc",
"chromeos/aura_desktop_capturer_unittest.cc",
"chromeos/clipboard_aura_unittest.cc",
"chromoting_host_context_unittest.cc",
"chromoting_host_unittest.cc",
"client_session_unittest.cc",
"config_file_watcher_unittest.cc",
"daemon_process_unittest.cc",
"desktop_process_unittest.cc",
"desktop_shape_tracker_unittest.cc",
"gnubby_auth_handler_posix_unittest.cc",
"heartbeat_sender_unittest.cc",
"host_change_notification_listener_unittest.cc",
"host_config_unittest.cc",
"host_extension_session_manager_unittest.cc",
"host_mock_objects.cc",
"host_status_logger_unittest.cc",
"ipc_desktop_environment_unittest.cc",
"it2me/it2me_confirmation_dialog_proxy_unittest.cc",
"it2me/it2me_native_messaging_host_unittest.cc",
"linux/audio_pipe_reader_unittest.cc",
"linux/unicode_to_keysym_unittest.cc",
"linux/x_server_clipboard_unittest.cc",
"local_input_monitor_unittest.cc",
"mouse_shape_pump_unittest.cc",
"native_messaging/native_messaging_reader_unittest.cc",
"native_messaging/native_messaging_writer_unittest.cc",
"pairing_registry_delegate_linux_unittest.cc",
"pairing_registry_delegate_win_unittest.cc",
"pin_hash_unittest.cc",
"policy_watcher_unittest.cc",
"register_support_host_request_unittest.cc",
"remote_input_filter_unittest.cc",
"resizing_host_observer_unittest.cc",
"screen_resolution_unittest.cc",
"server_log_entry_host_unittest.cc",
"setup/me2me_native_messaging_host_unittest.cc",
"setup/oauth_helper_unittest.cc",
"setup/pin_validator_unittest.cc",
"shaped_desktop_capturer_unittest.cc",
"token_validator_factory_impl_unittest.cc",
"video_frame_pump_unittest.cc",
"video_frame_recorder_unittest.cc",
"win/rdp_client_unittest.cc",
"win/worker_process_launcher.cc",
"win/worker_process_launcher.h",
"win/worker_process_launcher_unittest.cc",
]
if (use_ozone || is_chromeos) {
sources -= [ "local_input_monitor_unittest.cc" ]
}
if (is_chromeos) {
sources -= [ "linux/x_server_clipboard_unittest.cc" ]
} }
deps = [ source_set("test_support") {
":host", testonly = true
":test_support",
"//components/policy:policy_component_test_support",
"//remoting/host/setup",
"//remoting/host/it2me:common",
"//remoting/host/native_messaging",
"//remoting/proto",
"//skia",
"//testing/gmock",
"//testing/gtest",
]
}
if (is_win) { sources = [
import("//build/toolchain/win/midl.gni") "fake_desktop_capturer.cc",
import("//remoting/tools/build/message_compiler.gni") "fake_desktop_capturer.h",
"fake_desktop_environment.cc",
# TODO(brettw) these should not be generated via exec_script. This should be "fake_desktop_environment.h",
# part of the build process rather than the metabuild. Instead, a script "fake_host_extension.cc",
# should generate a header containing the #defines for this as well as the "fake_host_extension.h",
# IDL file with the values. "fake_host_status_monitor.h",
clsids = exec_script("win/get_clsids.py", "fake_host_status_monitor.h",
[ "fake_mouse_cursor_monitor.cc",
remoting_srcs_gypi_values.daemon_controller_guid, "fake_mouse_cursor_monitor.h",
remoting_srcs_gypi_values.rdp_desktop_session_guid,
version_full,
],
"value")
daemon_controller_clsid = clsids[0]
rdp_desktop_session_clsid = clsids[1]
action("generate_idl") {
script = "//build/util/version.py"
inputs = [
"win/chromoting_lib_idl.templ",
]
outputs = [
"$target_gen_dir/chromoting_lib.idl",
]
args = [
"-e",
"DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
"-e",
"RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
rebase_path(inputs[0], root_build_dir),
rebase_path(outputs[0], root_build_dir),
] ]
}
midl("remoting_lib_idl") {
sources = get_target_outputs(":generate_idl")
deps = [ deps = [
":generate_idl", "//remoting/proto",
"//testing/gtest",
] ]
public_deps = [
":host",
]
if (enable_webrtc) {
public_deps += [
"//third_party/libjingle:libpeerconnection",
"//third_party/webrtc/modules/desktop_capture",
]
}
} }
# Makes the .mc file from the .mc.jinja file. # The host portions of the remoting unit tests.
remoting_localize("messages_localizing") { source_set("unit_tests") {
testonly = true
sources = [ sources = [
"win/host_messages.mc.jinja2", "audio_pump_unittest.cc",
"audio_silence_detector_unittest.cc",
"capture_scheduler_unittest.cc",
"chromeos/aura_desktop_capturer_unittest.cc",
"chromeos/clipboard_aura_unittest.cc",
"chromoting_host_context_unittest.cc",
"chromoting_host_unittest.cc",
"client_session_unittest.cc",
"config_file_watcher_unittest.cc",
"daemon_process_unittest.cc",
"desktop_process_unittest.cc",
"desktop_shape_tracker_unittest.cc",
"gnubby_auth_handler_posix_unittest.cc",
"heartbeat_sender_unittest.cc",
"host_change_notification_listener_unittest.cc",
"host_config_unittest.cc",
"host_extension_session_manager_unittest.cc",
"host_mock_objects.cc",
"host_status_logger_unittest.cc",
"ipc_desktop_environment_unittest.cc",
"it2me/it2me_confirmation_dialog_proxy_unittest.cc",
"it2me/it2me_native_messaging_host_unittest.cc",
"linux/audio_pipe_reader_unittest.cc",
"linux/unicode_to_keysym_unittest.cc",
"linux/x_server_clipboard_unittest.cc",
"local_input_monitor_unittest.cc",
"mouse_shape_pump_unittest.cc",
"native_messaging/native_messaging_reader_unittest.cc",
"native_messaging/native_messaging_writer_unittest.cc",
"pairing_registry_delegate_linux_unittest.cc",
"pairing_registry_delegate_win_unittest.cc",
"pin_hash_unittest.cc",
"policy_watcher_unittest.cc",
"register_support_host_request_unittest.cc",
"remote_input_filter_unittest.cc",
"resizing_host_observer_unittest.cc",
"screen_resolution_unittest.cc",
"server_log_entry_host_unittest.cc",
"setup/me2me_native_messaging_host_unittest.cc",
"setup/oauth_helper_unittest.cc",
"setup/pin_validator_unittest.cc",
"shaped_desktop_capturer_unittest.cc",
"token_validator_factory_impl_unittest.cc",
"video_frame_pump_unittest.cc",
"video_frame_recorder_unittest.cc",
"win/rdp_client_unittest.cc",
"win/worker_process_launcher.cc",
"win/worker_process_launcher.h",
"win/worker_process_launcher_unittest.cc",
] ]
locales = remoting_locales
locale_dir = webapp_locale_dir
encoding = "utf-16"
# This target is funny. It only produces one file and the output doesn't
# match the input. We want to generate remoting_host_messages.mc from
# host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
# output, so the following pattern produces the name we want with a template
# based on the input.
#
# TODO: This is for GYP compat. We should just make the names match instead.
output = "$target_gen_dir/remoting_{{source_name_part}}"
}
# Makes the .h/.rc files from the .mc file. if (use_ozone || is_chromeos) {
message_compiler("messages") { sources -= [ "local_input_monitor_unittest.cc" ]
sources = get_target_outputs(":messages_localizing") }
if (is_chromeos) {
sources -= [ "linux/x_server_clipboard_unittest.cc" ]
}
deps = [ deps = [
":messages_localizing", ":host",
":test_support",
"//components/policy:policy_component_test_support",
"//remoting/host/setup",
"//remoting/host/it2me:common",
"//remoting/host/native_messaging",
"//remoting/proto",
"//skia",
"//testing/gmock",
"//testing/gtest",
] ]
} }
# TODO(GYP) More Windows remoting targets from remoting_host_win.gypi if (is_win) {
import("//build/toolchain/win/midl.gni")
import("//remoting/tools/build/message_compiler.gni")
# TODO(brettw) these should not be generated via exec_script. This should be
# part of the build process rather than the metabuild. Instead, a script
# should generate a header containing the #defines for this as well as the
# IDL file with the values.
clsids = exec_script("win/get_clsids.py",
[
remoting_srcs_gypi_values.daemon_controller_guid,
remoting_srcs_gypi_values.rdp_desktop_session_guid,
version_full,
],
"value")
daemon_controller_clsid = clsids[0]
rdp_desktop_session_clsid = clsids[1]
action("generate_idl") {
script = "//build/util/version.py"
inputs = [
"win/chromoting_lib_idl.templ",
]
outputs = [
"$target_gen_dir/chromoting_lib.idl",
]
args = [
"-e",
"DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
"-e",
"RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
rebase_path(inputs[0], root_build_dir),
rebase_path(outputs[0], root_build_dir),
]
}
midl("remoting_lib_idl") {
sources = get_target_outputs(":generate_idl")
deps = [
":generate_idl",
]
}
# Makes the .mc file from the .mc.jinja file.
remoting_localize("messages_localizing") {
sources = [
"win/host_messages.mc.jinja2",
]
locales = remoting_locales
locale_dir = webapp_locale_dir
encoding = "utf-16"
# This target is funny. It only produces one file and the output doesn't
# match the input. We want to generate remoting_host_messages.mc from
# host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
# output, so the following pattern produces the name we want with a template
# based on the input.
#
# TODO: This is for GYP compat. We should just make the names match instead.
output = "$target_gen_dir/remoting_{{source_name_part}}"
}
# Makes the .h/.rc files from the .mc file.
message_compiler("messages") {
sources = get_target_outputs(":messages_localizing")
deps = [
":messages_localizing",
]
}
# TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment