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.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//remoting/remoting_host.gni")
8 import("//remoting/remoting_locales.gni")
9 import("//remoting/remoting_srcs.gni")
10 import("//remoting/remoting_version.gni")
11 import("//remoting/tools/build/remoting_localize.gni")
13 if (is_mac) { # TODO(GYP) Mac build of remoting host.
16 group("test_support") {
21 # This must be a static library instead of a source set because
22 # remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
23 # which in turn depends on remoting_me2me_host_static which isn't part of that
26 # TODO fix this, successful builds should not depend on static libraries
28 static_library("host") {
29 sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
35 configs += [ "//build/config/compiler:wexit_time_destructors" ]
37 defines = [ "WEBRTC_CHROMIUM_BUILD" ]
41 "//components/policy:policy_component_common",
46 "//remoting/protocol",
47 "//remoting/resources",
48 "//ui/events/platform",
49 "//ui/events:dom4_keycode_converter",
52 if (enable_configuration_policy) {
53 deps += [ "//components/policy:policy" ]
56 if (is_linux && !is_chromeos) {
62 "//build/config/linux:x11",
63 "//build/config/linux:xrandr",
66 deps += [ "//build/config/linux/gtk" ]
71 "input_injector_x11.cc",
72 "local_input_monitor_x11.cc",
75 # These will already be filtered out on non-Linux.
77 "linux/x_server_clipboard.cc",
78 "linux/x_server_clipboard.h",
99 deps += [ "//ui/ozone" ]
103 "input_injector_chromeos.cc",
104 "input_injector_chromeos.h",
105 "linux/x_server_clipboard.cc",
106 "linux/x_server_clipboard.h",
107 "local_input_monitor_x11.cc",
112 "continue_window_linux.cc",
113 "disconnect_window_linux.cc",
118 # TODO(GYP) Mac host_bundle_name and prefpane_bundle_name.
119 # Note if you are looking at this: It really sucks to have to synchronously
120 # call into python twice to get these values. They should instead be
121 # written into a generated header via the process_version template, and we
122 # change the source files to include that header rather than rely on these
123 # defines being set in the build.
125 # "HOST_BUNDLE_NAME=\"$host_bundle_name\"",
126 # "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"",
130 "Accelerate.framework",
134 deps += [ "//third_party/google_toolbox_for_mac" ]
146 "//third_party/libjingle:libpeerconnection",
147 "//third_party/webrtc/modules/desktop_capture",
151 rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources,
157 source_set("test_support") {
161 "fake_desktop_capturer.cc",
162 "fake_desktop_capturer.h",
163 "fake_desktop_environment.cc",
164 "fake_desktop_environment.h",
165 "fake_host_extension.cc",
166 "fake_host_extension.h",
167 "fake_host_status_monitor.h",
168 "fake_host_status_monitor.h",
169 "fake_mouse_cursor_monitor.cc",
170 "fake_mouse_cursor_monitor.h",
183 "//third_party/libjingle:libpeerconnection",
184 "//third_party/webrtc/modules/desktop_capture",
189 # The host portions of the remoting unit tests.
190 source_set("unit_tests") {
194 "audio_pump_unittest.cc",
195 "audio_silence_detector_unittest.cc",
196 "capture_scheduler_unittest.cc",
197 "chromeos/aura_desktop_capturer_unittest.cc",
198 "chromeos/clipboard_aura_unittest.cc",
199 "chromoting_host_context_unittest.cc",
200 "chromoting_host_unittest.cc",
201 "client_session_unittest.cc",
202 "config_file_watcher_unittest.cc",
203 "daemon_process_unittest.cc",
204 "desktop_process_unittest.cc",
205 "desktop_shape_tracker_unittest.cc",
206 "gnubby_auth_handler_posix_unittest.cc",
207 "heartbeat_sender_unittest.cc",
208 "host_change_notification_listener_unittest.cc",
209 "host_config_unittest.cc",
210 "host_extension_session_manager_unittest.cc",
211 "host_mock_objects.cc",
212 "host_status_logger_unittest.cc",
213 "ipc_desktop_environment_unittest.cc",
214 "it2me/it2me_confirmation_dialog_proxy_unittest.cc",
215 "it2me/it2me_native_messaging_host_unittest.cc",
216 "linux/audio_pipe_reader_unittest.cc",
217 "linux/unicode_to_keysym_unittest.cc",
218 "linux/x_server_clipboard_unittest.cc",
219 "local_input_monitor_unittest.cc",
220 "mouse_shape_pump_unittest.cc",
221 "native_messaging/native_messaging_reader_unittest.cc",
222 "native_messaging/native_messaging_writer_unittest.cc",
223 "pairing_registry_delegate_linux_unittest.cc",
224 "pairing_registry_delegate_win_unittest.cc",
225 "pin_hash_unittest.cc",
226 "policy_watcher_unittest.cc",
227 "register_support_host_request_unittest.cc",
228 "remote_input_filter_unittest.cc",
229 "resizing_host_observer_unittest.cc",
230 "screen_resolution_unittest.cc",
231 "server_log_entry_host_unittest.cc",
232 "setup/me2me_native_messaging_host_unittest.cc",
233 "setup/oauth_helper_unittest.cc",
234 "setup/pin_validator_unittest.cc",
235 "shaped_desktop_capturer_unittest.cc",
236 "token_validator_factory_impl_unittest.cc",
237 "video_frame_pump_unittest.cc",
238 "video_frame_recorder_unittest.cc",
239 "win/rdp_client_unittest.cc",
240 "win/worker_process_launcher.cc",
241 "win/worker_process_launcher.h",
242 "win/worker_process_launcher_unittest.cc",
245 if (use_ozone || is_chromeos) {
246 sources -= [ "local_input_monitor_unittest.cc" ]
249 sources -= [ "linux/x_server_clipboard_unittest.cc" ]
255 "//remoting/host/setup",
256 "//remoting/host/it2me:common",
257 "//remoting/host/native_messaging",
264 if (enable_configuration_policy) {
265 deps += [ "//components/policy:policy_component_test_support" ]
270 import("//build/toolchain/win/midl.gni")
271 import("//remoting/tools/build/message_compiler.gni")
273 # TODO(brettw) these should not be generated via exec_script. This should be
274 # part of the build process rather than the metabuild. Instead, a script
275 # should generate a header containing the #defines for this as well as the
276 # IDL file with the values.
277 clsids = exec_script("win/get_clsids.py",
279 remoting_srcs_gypi_values.daemon_controller_guid,
280 remoting_srcs_gypi_values.rdp_desktop_session_guid,
284 daemon_controller_clsid = clsids[0]
285 rdp_desktop_session_clsid = clsids[1]
287 action("generate_idl") {
288 script = "//build/util/version.py"
291 "win/chromoting_lib_idl.templ",
294 "$target_gen_dir/chromoting_lib.idl",
299 "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
301 "RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
302 rebase_path(inputs[0], root_build_dir),
303 rebase_path(outputs[0], root_build_dir),
307 midl("remoting_lib_idl") {
308 sources = get_target_outputs(":generate_idl")
314 # Makes the .mc file from the .mc.jinja file.
315 remoting_localize("messages_localizing") {
317 "win/host_messages.mc.jinja2",
319 locales = remoting_locales
320 locale_dir = webapp_locale_dir
323 # This target is funny. It only produces one file and the output doesn't
324 # match the input. We want to generate remoting_host_messages.mc from
325 # host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
326 # output, so the following pattern produces the name we want with a template
327 # based on the input.
329 # TODO: This is for GYP compat. We should just make the names match instead.
330 output = "$target_gen_dir/remoting_{{source_name_part}}"
333 # Makes the .h/.rc files from the .mc file.
334 message_compiler("messages") {
335 sources = get_target_outputs(":messages_localizing")
337 ":messages_localizing",
341 # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
344 if (enable_remoting_host) {
345 executable("remoting_start_host") {
347 "setup/host_starter.cc",
348 "setup/host_starter.h",
349 "setup/start_host.cc",
353 "//remoting/host/setup",
357 deps += [ "//third_party/libjingle:libjingle_webrtc" ]
362 if (enable_me2me_host) {
363 source_set("remoting_me2me_host_static") {
366 "curtain_mode_linux.cc",
367 "curtain_mode_mac.cc",
368 "curtain_mode_win.cc",
369 "pam_authorization_factory_posix.cc",
370 "pam_authorization_factory_posix.h",
371 "posix/signal_handler.cc",
372 "posix/signal_handler.h",
373 "remoting_me2me_host.cc",
376 configs += [ "//remoting:version" ]
381 "//components/policy",
382 "//components/policy:policy_component_common",
387 "//third_party/webrtc/modules/desktop_capture",
391 deps += [ "//third_party/libjingle:libjingle_webrtc" ]
395 deps += [ "//build/config/linux/gtk" ]
397 if (is_linux || is_mac) {
403 executable("remoting_me2me_host") {
410 ":remoting_me2me_host_static",