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_locales.gni")
8 import("//remoting/remoting_srcs.gni")
9 import("//remoting/remoting_version.gni")
10 import("//remoting/tools/build/remoting_localize.gni")
12 if (is_mac) { # TODO(GYP) Mac build of remoting host.
15 group("test_support") {
20 # This must be a static library instead of a source set because
21 # remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
22 # which in turn depends on remoting_me2me_host_static which isn't part of that
25 # TODO fix this, successful builds should not depend on static libraries
27 static_library("host") {
28 sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
34 configs += [ "//build/config/compiler:wexit_time_destructors" ]
36 defines = [ "WEBRTC_CHROMIUM_BUILD" ]
40 "//components/policy:policy",
41 "//components/policy:policy_component_common",
46 "//remoting/protocol",
47 "//remoting/resources",
48 "//ui/events/platform",
49 "//ui/events:dom4_keycode_converter",
52 if (is_linux && !is_chromeos) {
58 "//build/config/linux:x11",
59 "//build/config/linux:xrandr",
62 deps += [ "//build/config/linux/gtk" ]
67 "input_injector_x11.cc",
68 "local_input_monitor_x11.cc",
71 # These will already be filtered out on non-Linux.
73 "linux/x_server_clipboard.cc",
74 "linux/x_server_clipboard.h",
95 sources -= [ "input_injector_x11.cc" ]
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 "//components/policy:policy_component_test_support",
256 "//remoting/host/setup",
257 "//remoting/host/it2me:common",
258 "//remoting/host/native_messaging",
267 import("//build/toolchain/win/midl.gni")
268 import("//remoting/tools/build/message_compiler.gni")
270 # TODO(brettw) these should not be generated via exec_script. This should be
271 # part of the build process rather than the metabuild. Instead, a script
272 # should generate a header containing the #defines for this as well as the
273 # IDL file with the values.
274 clsids = exec_script("win/get_clsids.py",
276 remoting_srcs_gypi_values.daemon_controller_guid,
277 remoting_srcs_gypi_values.rdp_desktop_session_guid,
281 daemon_controller_clsid = clsids[0]
282 rdp_desktop_session_clsid = clsids[1]
284 action("generate_idl") {
285 script = "//build/util/version.py"
288 "win/chromoting_lib_idl.templ",
291 "$target_gen_dir/chromoting_lib.idl",
296 "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
298 "RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
299 rebase_path(inputs[0], root_build_dir),
300 rebase_path(outputs[0], root_build_dir),
304 midl("remoting_lib_idl") {
305 sources = get_target_outputs(":generate_idl")
311 # Makes the .mc file from the .mc.jinja file.
312 remoting_localize("messages_localizing") {
314 "win/host_messages.mc.jinja2",
316 locales = remoting_locales
317 locale_dir = webapp_locale_dir
320 # This target is funny. It only produces one file and the output doesn't
321 # match the input. We want to generate remoting_host_messages.mc from
322 # host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
323 # output, so the following pattern produces the name we want with a template
324 # based on the input.
326 # TODO: This is for GYP compat. We should just make the names match instead.
327 output = "$target_gen_dir/remoting_{{source_name_part}}"
330 # Makes the .h/.rc files from the .mc file.
331 message_compiler("messages") {
332 sources = get_target_outputs(":messages_localizing")
334 ":messages_localizing",
338 # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi