OLD | NEW |
| (Empty) |
1 # Copyright 2016 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. | |
4 | |
5 import("//remoting/build/config/remoting_build.gni") | |
6 import("//remoting/host/installer/win/generate_clsids.gni") | |
7 import("//build/toolchain/win/midl.gni") | |
8 import("//build/win/message_compiler.gni") | |
9 | |
10 group("all") { | |
11 testonly = true | |
12 | |
13 deps = [ | |
14 ":remoting_console", | |
15 ":remoting_desktop", | |
16 ":remoting_me2me_host", | |
17 ":remoting_native_messaging_host", | |
18 "//remoting/host/security_key:remote_security_key", | |
19 ] | |
20 } | |
21 | |
22 # Reference this manifest to indicate that a process is per-monitor DPI aware. | |
23 dpi_aware_manifest = "//remoting/host/win/dpi_aware.manifest" | |
24 | |
25 # Reference this manifest to give the binary the uiAccess privilege. | |
26 enable_uiaccess_manifest = "//remoting/host/win/enable_uiaccess.manifest" | |
27 | |
28 # Depending on this target gives a default executable manifest with the addition | |
29 # of the DPI aware tag. | |
30 windows_manifest("dpi_aware_exe_manifest") { | |
31 sources = [ | |
32 as_invoker_manifest, | |
33 common_controls_manifest, | |
34 default_compatibility_manifest, | |
35 dpi_aware_manifest, | |
36 ] | |
37 type = "exe" | |
38 } | |
39 | |
40 # Depending on this target gives a default executable manifest with the addition | |
41 # of the DPI aware tag and a requestedExecutionLevel of requireAdministrator. | |
42 windows_manifest("dpi_aware_elevated_exe_manifest") { | |
43 sources = [ | |
44 common_controls_manifest, | |
45 default_compatibility_manifest, | |
46 dpi_aware_manifest, | |
47 require_administrator_manifest, | |
48 ] | |
49 type = "exe" | |
50 } | |
51 | |
52 # Depending on this target gives the executable a default manifest with the | |
53 # addition of the DPI aware tag and enables uiAccess. | |
54 windows_manifest("dpi_aware_uiaccess_exe_manifest") { | |
55 sources = [ | |
56 common_controls_manifest, | |
57 default_compatibility_manifest, | |
58 dpi_aware_manifest, | |
59 enable_uiaccess_manifest, | |
60 ] | |
61 type = "exe" | |
62 } | |
63 | |
64 source_set("win") { | |
65 sources = [ | |
66 "com_imported_mstscax.tlh", | |
67 "com_security.cc", | |
68 "com_security.h", | |
69 "elevation_helpers.cc", | |
70 "elevation_helpers.h", | |
71 "launch_process_with_token.cc", | |
72 "launch_process_with_token.h", | |
73 "omaha.cc", | |
74 "omaha.h", | |
75 "rdp_client.cc", | |
76 "rdp_client.h", | |
77 "rdp_client_window.cc", | |
78 "rdp_client_window.h", | |
79 "security_descriptor.cc", | |
80 "security_descriptor.h", | |
81 "session_desktop_environment.cc", | |
82 "session_desktop_environment.h", | |
83 "session_input_injector.cc", | |
84 "session_input_injector.h", | |
85 "window_station_and_desktop.cc", | |
86 "window_station_and_desktop.h", | |
87 "worker_process_launcher.cc", | |
88 "worker_process_launcher.h", | |
89 "wts_terminal_monitor.cc", | |
90 "wts_terminal_monitor.h", | |
91 "wts_terminal_observer.h", | |
92 ] | |
93 | |
94 configs += [ | |
95 "//build/config/compiler:wexit_time_destructors", | |
96 "//remoting/build/config:version", | |
97 ] | |
98 | |
99 defines = [ "WEBRTC_CHROMIUM_BUILD" ] | |
100 | |
101 deps = [ | |
102 "//base:i18n", | |
103 "//components/policy/core/common", | |
104 "//content/public/common", | |
105 "//crypto", | |
106 "//device/power_save_blocker", | |
107 "//google_apis", | |
108 "//ipc", | |
109 "//remoting/base", | |
110 "//remoting/host/security_key", | |
111 "//remoting/host/win:messages", | |
112 "//remoting/host/win:remoting_lib_idl", | |
113 "//remoting/protocol", | |
114 "//remoting/resources", | |
115 "//ui/base", | |
116 "//ui/events:dom_keycode_converter", | |
117 "//ui/events/platform", | |
118 ] | |
119 | |
120 if (enable_configuration_policy) { | |
121 deps += [ "//components/policy:generated" ] | |
122 } | |
123 | |
124 if (enable_webrtc) { | |
125 deps += [ "//third_party/webrtc/modules/desktop_capture" ] | |
126 } | |
127 } | |
128 | |
129 source_set("unit_tests") { | |
130 testonly = true | |
131 | |
132 sources = [ | |
133 "elevated_native_messaging_host.cc", | |
134 "elevated_native_messaging_host.h", | |
135 "launch_native_messaging_host_process.cc", | |
136 "launch_native_messaging_host_process.h", | |
137 "rdp_client_unittest.cc", | |
138 "worker_process_launcher_unittest.cc", | |
139 ] | |
140 | |
141 deps = [ | |
142 "//remoting/host", | |
143 "//remoting/host:test_support", | |
144 "//remoting/host/it2me:common", | |
145 "//remoting/host/native_messaging", | |
146 "//remoting/host/security_key:unit_tests", | |
147 "//remoting/host/setup", | |
148 "//remoting/proto", | |
149 "//remoting/resources", | |
150 "//skia", | |
151 "//testing/gmock", | |
152 "//testing/gtest", | |
153 ] | |
154 } | |
155 | |
156 action("generate_idl") { | |
157 script = "//build/util/version.py" | |
158 | |
159 inputs = [ | |
160 "chromoting_lib_idl.templ", | |
161 ] | |
162 outputs = [ | |
163 "$target_gen_dir/chromoting_lib.idl", | |
164 ] | |
165 | |
166 args = [ | |
167 "-e", | |
168 "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'", | |
169 "-e", | |
170 "RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'", | |
171 rebase_path(inputs[0], root_build_dir), | |
172 rebase_path(outputs[0], root_build_dir), | |
173 ] | |
174 } | |
175 | |
176 midl("remoting_lib_idl") { | |
177 sources = get_target_outputs(":generate_idl") | |
178 deps = [ | |
179 ":generate_idl", | |
180 ] | |
181 } | |
182 | |
183 config("MIDL_config") { | |
184 if (is_clang) { | |
185 cflags = [ | |
186 # MIDL generated code has a habit of omitting optional braces. | |
187 "-Wno-missing-braces", | |
188 | |
189 # Source files generated by the MIDL compiler trigger warnings with | |
190 # -Wincompatible-pointer-types enabled. | |
191 "-Wno-incompatible-pointer-types", | |
192 | |
193 # Generated code contains unused variables. | |
194 "-Wno-unused-variable", | |
195 | |
196 # PROXYFILE_LIST_START is an extern with initializer. | |
197 "-Wno-extern-initializer", | |
198 ] | |
199 } | |
200 } | |
201 | |
202 static_library("remoting_lib_ps") { | |
203 configs += [ ":MIDL_config" ] | |
204 | |
205 defines = [ | |
206 "ENTRY_PREFIX=Ps", | |
207 "REGISTER_PROXY_DLL", | |
208 ] | |
209 | |
210 deps = [ | |
211 ":remoting_lib_idl", | |
212 ] | |
213 | |
214 sources = [ | |
215 "$root_gen_dir/remoting/host/win/chromoting_lib.dlldata.c", | |
216 "$root_gen_dir/remoting/host/win/chromoting_lib_p.c", | |
217 ] | |
218 } | |
219 | |
220 # Makes the .mc file from the .mc.jinja file. | |
221 remoting_localize("messages_localizing") { | |
222 sources = [ | |
223 "host_messages.mc.jinja2", | |
224 ] | |
225 locales = remoting_locales | |
226 locale_dir = webapp_locale_dir | |
227 encoding = "utf-16" | |
228 | |
229 # This target is funny. It only produces one file and the output doesn't | |
230 # match the input. We want to generate remoting_host_messages.mc from | |
231 # host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the | |
232 # output, so the following pattern produces the name we want with a template | |
233 # based on the input. | |
234 # | |
235 # TODO: This is for GYP compat. We should just make the names match instead. | |
236 output = "$target_gen_dir/remoting_{{source_name_part}}" | |
237 } | |
238 | |
239 # Makes the .h/.rc files from the .mc file. | |
240 message_compiler("messages") { | |
241 compile_generated_code = false | |
242 sources = get_target_outputs(":messages_localizing") | |
243 deps = [ | |
244 ":messages_localizing", | |
245 ] | |
246 } | |
247 | |
248 executable("remoting_console") { | |
249 configs += [ "//build/config/compiler:wexit_time_destructors" ] | |
250 | |
251 defines = host_predefines + [ "BINARY=BINARY_HOST_ME2ME" ] | |
252 | |
253 deps = [ | |
254 ":dpi_aware_exe_manifest", | |
255 ":remoting_core", | |
256 ":remoting_windows_resources", | |
257 ] | |
258 | |
259 sources = [ | |
260 "$root_gen_dir/remoting/version.rc", | |
261 "entry_point.cc", | |
262 ] | |
263 | |
264 ldflags = [ | |
265 "/ENTRY:HostEntryPoint", | |
266 # "/NODEFAULTLIB", | |
267 ] | |
268 } | |
269 | |
270 executable("remoting_me2me_host") { | |
271 configs += [ | |
272 "//build/config/compiler:wexit_time_destructors", | |
273 "//build/config/win:windowed", | |
274 "//remoting/build/config:remoting_me2me_host", | |
275 ] | |
276 | |
277 defines = host_predefines + [ "BINARY=BINARY_HOST_ME2ME" ] | |
278 | |
279 deps = [ | |
280 ":dpi_aware_exe_manifest", | |
281 ":remoting_core", | |
282 ":remoting_windows_resources", | |
283 ] | |
284 | |
285 sources = [ | |
286 "$root_gen_dir/remoting/version.rc", | |
287 "entry_point.cc", | |
288 ] | |
289 | |
290 output_name = "remoting_host" | |
291 | |
292 ldflags = [ "/ENTRY:HostEntryPoint" ] | |
293 } | |
294 | |
295 shared_library("remoting_core") { | |
296 configs += [ "//build/config/compiler:wexit_time_destructors" ] | |
297 | |
298 defines = host_predefines + [ | |
299 "_ATL_APARTMENT_THREADED", | |
300 "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS", | |
301 "_ATL_NO_AUTOMATIC_NAMESPACE", | |
302 "_ATL_NO_EXCEPTIONS", | |
303 "BINARY=BINARY_CORE", | |
304 "DAEMON_CONTROLLER_CLSID=\"$daemon_controller_clsid\"", | |
305 "RDP_DESKTOP_SESSION_CLSID=\"$rdp_desktop_session_clsid\"", | |
306 "HOST_IMPLEMENTATION", | |
307 "ISOLATION_AWARE_ENABLED=1", | |
308 "STRICT", | |
309 "VERSION=$chrome_version_full", | |
310 ] | |
311 | |
312 if (remoting_multi_process != 0 && remoting_rdp_session != 0) { | |
313 defines += [ "REMOTING_RDP_SESSION" ] | |
314 } | |
315 | |
316 if (remoting_multi_process != 0) { | |
317 defines += [ "REMOTING_MULTI_PROCESS" ] | |
318 } | |
319 | |
320 sources = [ | |
321 "$root_gen_dir/remoting/core.rc", | |
322 "$root_gen_dir/remoting/host/win/remoting_host_messages.rc", | |
323 "$root_gen_dir/remoting/version.rc", | |
324 "//remoting/host/desktop_process_main.cc", | |
325 "//remoting/host/host_main.cc", | |
326 "//remoting/host/host_main.h", | |
327 "//remoting/host/it2me/it2me_native_messaging_host_main.cc", | |
328 "//remoting/host/it2me/it2me_native_messaging_host_main.h", | |
329 "//remoting/host/setup/host_starter.cc", | |
330 "//remoting/host/setup/host_starter.h", | |
331 "//remoting/host/setup/me2me_native_messaging_host_main.cc", | |
332 "//remoting/host/setup/me2me_native_messaging_host_main.h", | |
333 "//remoting/host/setup/start_host_main.cc", | |
334 "//remoting/host/setup/start_host_main.h", | |
335 "//remoting/host/worker_process_ipc_delegate.h", | |
336 "chromoting_lib.rc", | |
337 "chromoting_module.cc", | |
338 "chromoting_module.h", | |
339 "core.cc", | |
340 "core_resource.h", | |
341 "elevated_native_messaging_host.cc", | |
342 "elevated_native_messaging_host.h", | |
343 "host_service.cc", | |
344 "host_service.h", | |
345 "launch_native_messaging_host_process.cc", | |
346 "launch_native_messaging_host_process.h", | |
347 "rdp_desktop_session.cc", | |
348 "rdp_desktop_session.h", | |
349 "unprivileged_process_delegate.cc", | |
350 "unprivileged_process_delegate.h", | |
351 "wts_session_process_delegate.cc", | |
352 "wts_session_process_delegate.h", | |
353 ] | |
354 | |
355 deps = [ | |
356 ":messages", | |
357 ":remoting_lib_idl", | |
358 ":remoting_lib_ps", | |
359 ":remoting_windows_resources", | |
360 ":win", | |
361 "//base", | |
362 "//base:base_static", | |
363 "//base/allocator", | |
364 "//base/third_party/dynamic_annotations", | |
365 "//build/win:default_exe_manifest", | |
366 "//ipc", | |
367 "//net", | |
368 "//remoting/base", | |
369 "//remoting/base:breakpad", | |
370 "//remoting/codec", | |
371 "//remoting/host:host", | |
372 "//remoting/host:remoting_me2me_host_static", | |
373 "//remoting/host/it2me:common", | |
374 "//remoting/host/native_messaging", | |
375 "//remoting/host/security_key:main", | |
376 "//remoting/host/setup", | |
377 "//remoting/protocol", | |
378 "//sandbox/win:sandbox", # Should always use Windows version | |
379 "//third_party/webrtc/modules/desktop_capture", | |
380 ] | |
381 | |
382 ldflags = [ | |
383 "/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE", | |
384 "/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE", | |
385 "/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE", | |
386 "/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE", | |
387 ] | |
388 | |
389 libs = [ | |
390 "comctl32.lib", | |
391 "rpcns4.lib", | |
392 "rpcrt4.lib", | |
393 "sas.lib", | |
394 "uuid.lib", | |
395 "wtsapi32.lib", | |
396 ] | |
397 | |
398 if (is_clang) { | |
399 cflags = [ "-Wno-header-hygiene" ] | |
400 } | |
401 } | |
402 | |
403 executable("remoting_desktop") { | |
404 configs += [ | |
405 "//build/config/compiler:wexit_time_destructors", | |
406 "//build/config/win:windowed", | |
407 ] | |
408 | |
409 defines = host_predefines + [ "BINARY=BINARY_DESKTOP" ] | |
410 | |
411 deps = [ | |
412 ":remoting_core", | |
413 ":remoting_windows_resources", | |
414 ] | |
415 | |
416 if (is_official_build) { | |
417 deps += [ ":dpi_aware_elevated_exe_manifest" ] | |
418 } else { | |
419 deps += [ ":dpi_aware_exe_manifest" ] | |
420 } | |
421 | |
422 sources = [ | |
423 "$root_gen_dir/remoting/version.rc", | |
424 "entry_point.cc", | |
425 ] | |
426 | |
427 ldflags = [ | |
428 "/ENTRY:HostEntryPoint", | |
429 # "/NODEFAULTLIB", | |
430 ] | |
431 } | |
432 | |
433 executable("remoting_native_messaging_host") { | |
434 configs += [ "//build/config/compiler:wexit_time_destructors" ] | |
435 | |
436 defines = host_predefines + [ "BINARY=BINARY_NATIVE_MESSAGING_HOST" ] | |
437 | |
438 deps = [ | |
439 ":remoting_core", | |
440 ":remoting_windows_resources", | |
441 "//build/win:default_exe_manifest", | |
442 ] | |
443 | |
444 sources = [ | |
445 "$root_gen_dir/remoting/version.rc", | |
446 "../setup/me2me_native_messaging_host_entry_point.cc", | |
447 ] | |
448 } | |
449 | |
450 remoting_localize("remoting_windows_resources") { | |
451 deps = [ | |
452 "//remoting/resources", | |
453 ] | |
454 | |
455 sources = [ | |
456 "core.rc.jinja2", | |
457 "version.rc.jinja2", | |
458 ] | |
459 | |
460 # TODO(zijiehe): Export lastchange_path from | |
461 # //chrome/version.gni:process_version | |
462 variables = [ | |
463 rebase_path(chrome_version_file), | |
464 rebase_path(remoting_version_file), | |
465 rebase_path("//build/util/LASTCHANGE"), | |
466 ] | |
467 | |
468 output = "$root_gen_dir/remoting/{{source_name_part}}" | |
469 | |
470 locale_dir = webapp_locale_dir | |
471 | |
472 encoding = "utf-16" | |
473 | |
474 locales = remoting_locales | |
475 } | |
476 # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi | |
OLD | NEW |