Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: remoting/host/BUILD.gn

Issue 977943003: Fix remoting GN Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/features.gni") 5 import("//build/config/features.gni")
6 import("//build/config/ui.gni") 6 import("//build/config/ui.gni")
7 import("//remoting/remoting_locales.gni") 7 import("//remoting/remoting_locales.gni")
8 import("//remoting/remoting_srcs.gni") 8 import("//remoting/remoting_srcs.gni")
9 import("//remoting/remoting_version.gni") 9 import("//remoting/remoting_version.gni")
10 import("//remoting/tools/build/remoting_localize.gni") 10 import("//remoting/tools/build/remoting_localize.gni")
11 11
12 # This must be a static library instead of a source set because 12 if (is_mac) { # TODO(GYP) Mac build of remoting host.
13 # remoting_unittests requires that remoting_me2me_host.cc not be pulled in, 13 group("host") {
14 # which in turn depends on remoting_me2me_host_static which isn't part of that 14 }
15 # build. 15 group("test_support") {
16 # 16 }
17 # TODO fix this, successful builds should not depend on static libraries 17 group("unit_tests") {
18 # stripping code. 18 }
19 static_library("host") { 19 } else {
20 sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources, 20 # This must be a static library instead of a source set because
21 ".", 21 # remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
22 "//remoting") 22 # which in turn depends on remoting_me2me_host_static which isn't part of that
23 23 # build.
24 libs = [] 24 #
25 25 # TODO fix this, successful builds should not depend on static libraries
26 configs += [ "//build/config/compiler:wexit_time_destructors" ] 26 # stripping code.
27 27 static_library("host") {
28 defines = [ "WEBRTC_CHROMIUM_BUILD" ] 28 sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
29 29 ".",
30 deps = [ 30 "//remoting")
31 "//base:i18n", 31
32 "//components/policy:policy", 32 libs = []
33 "//components/policy:policy_component_common", 33
34 "//crypto", 34 configs += [ "//build/config/compiler:wexit_time_destructors" ]
35 "//google_apis", 35
36 "//ipc", 36 defines = [ "WEBRTC_CHROMIUM_BUILD" ]
37 "//remoting/base", 37
38 "//remoting/protocol", 38 deps = [
39 "//remoting/resources", 39 "//base:i18n",
40 "//ui/events/platform", 40 "//components/policy:policy",
41 "//ui/events:dom4_keycode_converter", 41 "//components/policy:policy_component_common",
42 ] 42 "//crypto",
43 43 "//google_apis",
44 if (is_linux && !is_chromeos) { 44 "//ipc",
45 libs += [ "pam" ] 45 "//remoting/base",
46 } 46 "//remoting/protocol",
47 47 "//remoting/resources",
48 if (use_x11) { 48 "//ui/events/platform",
49 configs += [ 49 "//ui/events:dom4_keycode_converter",
50 "//build/config/linux:x11", 50 ]
51 "//build/config/linux:xrandr", 51
52 ] 52 if (is_linux && !is_chromeos) {
53 if (!is_chromeos) { 53 libs += [ "pam" ]
54 deps += [ "//build/config/linux/gtk" ] 54 }
55 } 55
56 } else { 56 if (use_x11) {
57 sources -= [ 57 configs += [
58 "clipboard_x11.cc", 58 "//build/config/linux:x11",
59 "input_injector_x11.cc", 59 "//build/config/linux:xrandr",
60 "local_input_monitor_x11.cc", 60 ]
61 ] 61 if (!is_chromeos) {
62 if (is_linux) { 62 deps += [ "//build/config/linux/gtk" ]
63 # These will already be filtered out on non-Linux. 63 }
64 sources -= [
65 "linux/x_server_clipboard.cc",
66 "linux/x_server_clipboard.h",
67 ]
68 }
69 }
70
71 if (is_chromeos) {
72 deps += [
73 "//cc",
74 "//ppapi/host",
75 "//skia",
76 "//ui/aura",
77 "//ui/compositor",
78 "//ui/events",
79 "//ui/views",
80 ]
81
82 if (use_ash) {
83 deps += [ "//ash" ]
84 }
85
86 if (!use_x11) {
87 sources -= [ "input_injector_x11.cc" ]
88 }
89
90 if (use_ozone) {
91 deps += [ "//ui/ozone" ]
92 } else { 64 } else {
93 sources -= [ 65 sources -= [
94 "clipboard_x11.cc", 66 "clipboard_x11.cc",
95 "input_injector_chromeos.cc", 67 "input_injector_x11.cc",
96 "input_injector_chromeos.h",
97 "linux/x_server_clipboard.cc",
98 "linux/x_server_clipboard.h",
99 "local_input_monitor_x11.cc", 68 "local_input_monitor_x11.cc",
100 ] 69 ]
101 } 70 if (is_linux) {
102 71 # These will already be filtered out on non-Linux.
103 sources -= [ 72 sources -= [
104 "continue_window_linux.cc", 73 "linux/x_server_clipboard.cc",
105 "disconnect_window_linux.cc", 74 "linux/x_server_clipboard.h",
106 ] 75 ]
107 } 76 }
108 77 }
109 if (is_mac) { 78
110 # TODO(GYP) Mac host_bundle_name and prefpane_bundle_name. 79 if (is_chromeos) {
111 # Note if you are looking at this: It really sucks to have to synchronously 80 deps += [
112 # call into python twice to get these values. They should instead be 81 "//cc",
113 # written into a generated header via the process_version template, and we 82 "//ppapi/host",
114 # change the source files to include that header rather than rely on these 83 "//skia",
115 # defines being set in the build. 84 "//ui/aura",
116 #defines += [ 85 "//ui/compositor",
117 # "HOST_BUNDLE_NAME=\"$host_bundle_name\"", 86 "//ui/events",
118 # "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"", 87 "//ui/views",
119 #] 88 ]
120 89
121 libs += [ 90 if (use_ash) {
122 "Accelerate.framework", 91 deps += [ "//ash" ]
123 "libpam.a", 92 }
124 ] 93
125 94 if (!use_x11) {
126 deps += [ "//google_toolbox_for_mac" ] 95 sources -= [ "input_injector_x11.cc" ]
96 }
97
98 if (use_ozone) {
99 deps += [ "//ui/ozone" ]
100 } else {
101 sources -= [
102 "clipboard_x11.cc",
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",
108 ]
109 }
110
111 sources -= [
112 "continue_window_linux.cc",
113 "disconnect_window_linux.cc",
114 ]
115 }
116
117 if (is_mac) {
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 synchronousl y
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.
124 #defines += [
125 # "HOST_BUNDLE_NAME=\"$host_bundle_name\"",
126 # "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"",
127 #]
128
129 libs += [
130 "Accelerate.framework",
131 "libpam.a",
132 ]
133
134 deps += [ "//third_party/google_toolbox_for_mac" ]
135 }
136
137 if (is_win) {
138 deps += [
139 ":messages",
140 ":remoting_lib_idl",
141 ]
142 }
143
144 if (enable_webrtc) {
145 deps += [
146 "//third_party/libjingle:libpeerconnection",
147 "//third_party/webrtc/modules/desktop_capture",
148 ]
149
150 sources +=
151 rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources,
152 ".",
153 "//remoting")
154 }
155 }
156
157 source_set("test_support") {
158 testonly = true
159
160 sources = [
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",
171 ]
172
173 deps = [
174 "//remoting/proto",
175 "//testing/gtest",
176 ]
177 public_deps = [
178 ":host",
179 ]
180
181 if (enable_webrtc) {
182 public_deps += [
183 "//third_party/libjingle:libpeerconnection",
184 "//third_party/webrtc/modules/desktop_capture",
185 ]
186 }
187 }
188
189 # The host portions of the remoting unit tests.
190 source_set("unit_tests") {
191 testonly = true
192
193 sources = [
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",
243 ]
244
245 if (use_ozone || is_chromeos) {
246 sources -= [ "local_input_monitor_unittest.cc" ]
247 }
248 if (is_chromeos) {
249 sources -= [ "linux/x_server_clipboard_unittest.cc" ]
250 }
251
252 deps = [
253 ":host",
254 ":test_support",
255 "//components/policy:policy_component_test_support",
256 "//remoting/host/setup",
257 "//remoting/host/it2me:common",
258 "//remoting/host/native_messaging",
259 "//remoting/proto",
260 "//skia",
261 "//testing/gmock",
262 "//testing/gtest",
263 ]
127 } 264 }
128 265
129 if (is_win) { 266 if (is_win) {
130 deps += [ 267 import("//build/toolchain/win/midl.gni")
131 ":messages", 268 import("//remoting/tools/build/message_compiler.gni")
132 ":remoting_lib_idl", 269
133 ] 270 # TODO(brettw) these should not be generated via exec_script. This should be
134 } 271 # part of the build process rather than the metabuild. Instead, a script
135 272 # should generate a header containing the #defines for this as well as the
136 if (enable_webrtc) { 273 # IDL file with the values.
137 deps += [ 274 clsids = exec_script("win/get_clsids.py",
138 "//third_party/libjingle:libpeerconnection", 275 [
139 "//third_party/webrtc/modules/desktop_capture", 276 remoting_srcs_gypi_values.daemon_controller_guid,
140 ] 277 remoting_srcs_gypi_values.rdp_desktop_session_guid,
141 278 version_full,
142 sources += rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources, 279 ],
143 ".", 280 "value")
144 "//remoting") 281 daemon_controller_clsid = clsids[0]
282 rdp_desktop_session_clsid = clsids[1]
283
284 action("generate_idl") {
285 script = "//build/util/version.py"
286
287 inputs = [
288 "win/chromoting_lib_idl.templ",
289 ]
290 outputs = [
291 "$target_gen_dir/chromoting_lib.idl",
292 ]
293
294 args = [
295 "-e",
296 "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
297 "-e",
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),
301 ]
302 }
303
304 midl("remoting_lib_idl") {
305 sources = get_target_outputs(":generate_idl")
306 deps = [
307 ":generate_idl",
308 ]
309 }
310
311 # Makes the .mc file from the .mc.jinja file.
312 remoting_localize("messages_localizing") {
313 sources = [
314 "win/host_messages.mc.jinja2",
315 ]
316 locales = remoting_locales
317 locale_dir = webapp_locale_dir
318 encoding = "utf-16"
319
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 templa te
324 # based on the input.
325 #
326 # TODO: This is for GYP compat. We should just make the names match instea d.
327 output = "$target_gen_dir/remoting_{{source_name_part}}"
328 }
329
330 # Makes the .h/.rc files from the .mc file.
331 message_compiler("messages") {
332 sources = get_target_outputs(":messages_localizing")
333 deps = [
334 ":messages_localizing",
335 ]
336 }
337
338 # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
145 } 339 }
146 } 340 }
147
148 source_set("test_support") {
149 testonly = true
150
151 sources = [
152 "fake_desktop_capturer.cc",
153 "fake_desktop_capturer.h",
154 "fake_desktop_environment.cc",
155 "fake_desktop_environment.h",
156 "fake_host_extension.cc",
157 "fake_host_extension.h",
158 "fake_host_status_monitor.h",
159 "fake_host_status_monitor.h",
160 "fake_mouse_cursor_monitor.cc",
161 "fake_mouse_cursor_monitor.h",
162 ]
163
164 deps = [
165 "//remoting/proto",
166 "//testing/gtest",
167 ]
168 public_deps = [
169 ":host",
170 ]
171
172 if (enable_webrtc) {
173 public_deps += [
174 "//third_party/libjingle:libpeerconnection",
175 "//third_party/webrtc/modules/desktop_capture",
176 ]
177 }
178 }
179
180 # The host portions of the remoting unit tests.
181 source_set("unit_tests") {
182 testonly = true
183
184 sources = [
185 "audio_pump_unittest.cc",
186 "audio_silence_detector_unittest.cc",
187 "capture_scheduler_unittest.cc",
188 "chromeos/aura_desktop_capturer_unittest.cc",
189 "chromeos/clipboard_aura_unittest.cc",
190 "chromoting_host_context_unittest.cc",
191 "chromoting_host_unittest.cc",
192 "client_session_unittest.cc",
193 "config_file_watcher_unittest.cc",
194 "daemon_process_unittest.cc",
195 "desktop_process_unittest.cc",
196 "desktop_shape_tracker_unittest.cc",
197 "gnubby_auth_handler_posix_unittest.cc",
198 "heartbeat_sender_unittest.cc",
199 "host_change_notification_listener_unittest.cc",
200 "host_config_unittest.cc",
201 "host_extension_session_manager_unittest.cc",
202 "host_mock_objects.cc",
203 "host_status_logger_unittest.cc",
204 "ipc_desktop_environment_unittest.cc",
205 "it2me/it2me_confirmation_dialog_proxy_unittest.cc",
206 "it2me/it2me_native_messaging_host_unittest.cc",
207 "linux/audio_pipe_reader_unittest.cc",
208 "linux/unicode_to_keysym_unittest.cc",
209 "linux/x_server_clipboard_unittest.cc",
210 "local_input_monitor_unittest.cc",
211 "mouse_shape_pump_unittest.cc",
212 "native_messaging/native_messaging_reader_unittest.cc",
213 "native_messaging/native_messaging_writer_unittest.cc",
214 "pairing_registry_delegate_linux_unittest.cc",
215 "pairing_registry_delegate_win_unittest.cc",
216 "pin_hash_unittest.cc",
217 "policy_watcher_unittest.cc",
218 "register_support_host_request_unittest.cc",
219 "remote_input_filter_unittest.cc",
220 "resizing_host_observer_unittest.cc",
221 "screen_resolution_unittest.cc",
222 "server_log_entry_host_unittest.cc",
223 "setup/me2me_native_messaging_host_unittest.cc",
224 "setup/oauth_helper_unittest.cc",
225 "setup/pin_validator_unittest.cc",
226 "shaped_desktop_capturer_unittest.cc",
227 "token_validator_factory_impl_unittest.cc",
228 "video_frame_pump_unittest.cc",
229 "video_frame_recorder_unittest.cc",
230 "win/rdp_client_unittest.cc",
231 "win/worker_process_launcher.cc",
232 "win/worker_process_launcher.h",
233 "win/worker_process_launcher_unittest.cc",
234 ]
235
236 if (use_ozone || is_chromeos) {
237 sources -= [ "local_input_monitor_unittest.cc" ]
238 }
239 if (is_chromeos) {
240 sources -= [ "linux/x_server_clipboard_unittest.cc" ]
241 }
242
243 deps = [
244 ":host",
245 ":test_support",
246 "//components/policy:policy_component_test_support",
247 "//remoting/host/setup",
248 "//remoting/host/it2me:common",
249 "//remoting/host/native_messaging",
250 "//remoting/proto",
251 "//skia",
252 "//testing/gmock",
253 "//testing/gtest",
254 ]
255 }
256
257 if (is_win) {
258 import("//build/toolchain/win/midl.gni")
259 import("//remoting/tools/build/message_compiler.gni")
260
261 # TODO(brettw) these should not be generated via exec_script. This should be
262 # part of the build process rather than the metabuild. Instead, a script
263 # should generate a header containing the #defines for this as well as the
264 # IDL file with the values.
265 clsids = exec_script("win/get_clsids.py",
266 [
267 remoting_srcs_gypi_values.daemon_controller_guid,
268 remoting_srcs_gypi_values.rdp_desktop_session_guid,
269 version_full,
270 ],
271 "value")
272 daemon_controller_clsid = clsids[0]
273 rdp_desktop_session_clsid = clsids[1]
274
275 action("generate_idl") {
276 script = "//build/util/version.py"
277
278 inputs = [
279 "win/chromoting_lib_idl.templ",
280 ]
281 outputs = [
282 "$target_gen_dir/chromoting_lib.idl",
283 ]
284
285 args = [
286 "-e",
287 "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
288 "-e",
289 "RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
290 rebase_path(inputs[0], root_build_dir),
291 rebase_path(outputs[0], root_build_dir),
292 ]
293 }
294
295 midl("remoting_lib_idl") {
296 sources = get_target_outputs(":generate_idl")
297 deps = [
298 ":generate_idl",
299 ]
300 }
301
302 # Makes the .mc file from the .mc.jinja file.
303 remoting_localize("messages_localizing") {
304 sources = [
305 "win/host_messages.mc.jinja2",
306 ]
307 locales = remoting_locales
308 locale_dir = webapp_locale_dir
309 encoding = "utf-16"
310
311 # This target is funny. It only produces one file and the output doesn't
312 # match the input. We want to generate remoting_host_messages.mc from
313 # host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
314 # output, so the following pattern produces the name we want with a template
315 # based on the input.
316 #
317 # TODO: This is for GYP compat. We should just make the names match instead.
318 output = "$target_gen_dir/remoting_{{source_name_part}}"
319 }
320
321 # Makes the .h/.rc files from the .mc file.
322 message_compiler("messages") {
323 sources = get_target_outputs(":messages_localizing")
324 deps = [
325 ":messages_localizing",
326 ]
327 }
328
329 # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
330 }
OLDNEW
« no previous file with comments | « remoting/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698