OLD | NEW |
1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import("//build/config/crypto.gni") | 9 import("//build/config/crypto.gni") |
10 import("//build/config/ui.gni") | 10 import("//build/config/ui.gni") |
11 import("../webrtc.gni") | 11 import("../webrtc.gni") |
12 | 12 |
13 if (is_android) { | 13 if (is_android) { |
14 import("//build/config/android/config.gni") | 14 import("//build/config/android/config.gni") |
15 import("//build/config/android/rules.gni") | 15 import("//build/config/android/rules.gni") |
16 } | 16 } |
17 if (is_win) { | 17 if (is_win) { |
18 import("//build/config/clang/clang.gni") | 18 import("//build/config/clang/clang.gni") |
19 } | 19 } |
20 | 20 |
21 group("base") { | 21 group("base") { |
22 public_deps = [ | 22 public_deps = [ |
23 ":rtc_base", | 23 ":rtc_base", |
24 ":rtc_base_approved", | 24 ":rtc_base_approved", |
25 ":rtc_task_queue", | 25 ":rtc_task_queue", |
26 ":sequenced_task_checker", | 26 ":sequenced_task_checker", |
27 ":weak_ptr", | 27 ":weak_ptr", |
28 ] | 28 ] |
29 if (is_android) { | |
30 public_deps += [ ":base_java" ] | |
31 } | |
32 } | |
33 | |
34 config("rtc_base_approved_all_dependent_config") { | |
35 if (is_mac && !build_with_chromium) { | |
36 libs = [ "Foundation.framework" ] # needed for logging_mac.mm | |
37 } | |
38 } | |
39 | |
40 config("rtc_base_chromium_config") { | |
41 defines = [ "NO_MAIN_THREAD_WRAPPING" ] | |
42 } | |
43 | |
44 config("rtc_base_all_dependent_config") { | |
45 if (is_ios) { | |
46 libs = [ | |
47 "CFNetwork.framework", | |
48 "Security.framework", | |
49 "SystemConfiguration.framework", | |
50 "UIKit.framework", | |
51 ] | |
52 } | |
53 if (is_mac) { | |
54 libs = [ | |
55 "Cocoa.framework", | |
56 "Foundation.framework", | |
57 "IOKit.framework", | |
58 "Security.framework", | |
59 "SystemConfiguration.framework", | |
60 ] | |
61 } | |
62 } | 29 } |
63 | 30 |
64 if (!rtc_build_ssl) { | 31 if (!rtc_build_ssl) { |
65 config("external_ssl_library") { | 32 config("external_ssl_library") { |
66 assert(rtc_ssl_root != "", | 33 assert(rtc_ssl_root != "", |
67 "You must specify rtc_ssl_root when rtc_build_ssl==0.") | 34 "You must specify rtc_ssl_root when rtc_build_ssl==0.") |
68 include_dirs = [ rtc_ssl_root ] | 35 include_dirs = [ rtc_ssl_root ] |
69 } | 36 } |
70 } | 37 } |
71 | 38 |
72 source_set("protobuf_utils") { | 39 # The targets below are deprecated and only exist here temporarily during |
73 sources = [ | 40 # refactoring. See https://bugs.webrtc.org/7634 for more details. |
74 "protobuf_utils.h", | 41 |
75 ] | 42 group("protobuf_utils") { |
76 if (rtc_enable_protobuf) { | 43 public_deps = [ "../rtc_base:protobuf_utils" ] |
77 public_deps = [ | |
78 "//third_party/protobuf:protobuf_lite", | |
79 ] | |
80 } | |
81 } | 44 } |
82 | 45 |
83 source_set("compile_assert_c") { | 46 group("compile_assert_c") { |
84 sources = [ | 47 public_deps = [ "../rtc_base:compile_assert_c" ] |
85 "compile_assert_c.h", | |
86 ] | |
87 } | 48 } |
88 | 49 |
89 # The subset of rtc_base approved for use outside of libjingle. | 50 group("rtc_base_approved") { |
90 rtc_static_library("rtc_base_approved") { | 51 public_deps = [ "../rtc_base:rtc_base_approved" ] |
91 # TODO(kjellander): Remove (bugs.webrtc.org/7480) | |
92 # Enabling GN check triggers a cyclic dependency caused by rate_limiter.cc: | |
93 # :rtc_base_approved -> //webrtc/system_wrappers -> :rtc_base_approved | |
94 check_includes = false | |
95 defines = [] | |
96 libs = [] | |
97 deps = [] | |
98 all_dependent_configs = [ ":rtc_base_approved_all_dependent_config" ] | |
99 | |
100 sources = [ | |
101 "array_view.h", | |
102 "arraysize.h", | |
103 "atomicops.h", | |
104 "base64.cc", | |
105 "base64.h", | |
106 "basictypes.h", | |
107 "bind.h", | |
108 "bitbuffer.cc", | |
109 "bitbuffer.h", | |
110 "buffer.h", | |
111 "bufferqueue.cc", | |
112 "bufferqueue.h", | |
113 "bytebuffer.cc", | |
114 "bytebuffer.h", | |
115 "byteorder.h", | |
116 "checks.cc", | |
117 "checks.h", | |
118 "constructormagic.h", | |
119 "copyonwritebuffer.cc", | |
120 "copyonwritebuffer.h", | |
121 "criticalsection.cc", | |
122 "criticalsection.h", | |
123 "deprecation.h", | |
124 "event.cc", | |
125 "event.h", | |
126 "event_tracer.cc", | |
127 "event_tracer.h", | |
128 "file.cc", | |
129 "file.h", | |
130 "flags.cc", | |
131 "flags.h", | |
132 "format_macros.h", | |
133 "function_view.h", | |
134 "ignore_wundef.h", | |
135 "location.cc", | |
136 "location.h", | |
137 "mod_ops.h", | |
138 "onetimeevent.h", | |
139 "optional.cc", | |
140 "optional.h", | |
141 "pathutils.cc", | |
142 "pathutils.h", | |
143 "platform_file.cc", | |
144 "platform_file.h", | |
145 "platform_thread.cc", | |
146 "platform_thread.h", | |
147 "platform_thread_types.h", | |
148 "ptr_util.h", | |
149 "race_checker.cc", | |
150 "race_checker.h", | |
151 "random.cc", | |
152 "random.h", | |
153 "rate_limiter.cc", | |
154 "rate_limiter.h", | |
155 "rate_statistics.cc", | |
156 "rate_statistics.h", | |
157 "ratetracker.cc", | |
158 "ratetracker.h", | |
159 "refcount.h", | |
160 "refcountedobject.h", | |
161 "safe_compare.h", | |
162 "safe_conversions.h", | |
163 "safe_conversions_impl.h", | |
164 "safe_minmax.h", | |
165 "sanitizer.h", | |
166 "scoped_ref_ptr.h", | |
167 "string_to_number.cc", | |
168 "string_to_number.h", | |
169 "stringencode.cc", | |
170 "stringencode.h", | |
171 "stringize_macros.h", | |
172 "stringutils.cc", | |
173 "stringutils.h", | |
174 "swap_queue.h", | |
175 "template_util.h", | |
176 "thread_annotations.h", | |
177 "thread_checker.h", | |
178 "thread_checker_impl.cc", | |
179 "thread_checker_impl.h", | |
180 "timestampaligner.cc", | |
181 "timestampaligner.h", | |
182 "timeutils.cc", | |
183 "timeutils.h", | |
184 "trace_event.h", | |
185 "type_traits.h", | |
186 ] | |
187 | |
188 deps += [ "..:webrtc_common" ] | |
189 | |
190 if (is_android) { | |
191 libs += [ "log" ] | |
192 } | |
193 | |
194 if (is_posix) { | |
195 sources += [ "file_posix.cc" ] | |
196 } | |
197 | |
198 if (is_win) { | |
199 sources += [ "file_win.cc" ] | |
200 } | |
201 | |
202 if (build_with_chromium) { | |
203 # Dependency on chromium's logging (in //base). | |
204 deps += [ "//base:base" ] | |
205 sources += [ | |
206 "../../webrtc_overrides/webrtc/base/logging.cc", | |
207 "../../webrtc_overrides/webrtc/base/logging.h", | |
208 ] | |
209 } else { | |
210 sources += [ | |
211 "logging.cc", | |
212 "logging.h", | |
213 "logging_mac.mm", | |
214 ] | |
215 } | |
216 if (is_component_build && is_win) { | |
217 # Copy the VS runtime DLLs into the isolate so that they don't have to be | |
218 # preinstalled on the target machine. The debug runtimes have a "d" at | |
219 # the end. | |
220 # This is a copy of https://codereview.chromium.org/1783973002. | |
221 # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use, | |
222 # so we don't have to copy their changes and risk breakages. | |
223 # See http://crbug.com/653569 | |
224 if (is_debug) { | |
225 vcrt_suffix = "d" | |
226 } else { | |
227 vcrt_suffix = "" | |
228 } | |
229 | |
230 # These runtime files are copied to the output directory by the | |
231 # vs_toolchain script that runs as part of toolchain configuration. | |
232 data = [ | |
233 "$root_out_dir/msvcp140${vcrt_suffix}.dll", | |
234 "$root_out_dir/vccorlib140${vcrt_suffix}.dll", | |
235 "$root_out_dir/vcruntime140${vcrt_suffix}.dll", | |
236 | |
237 # Universal Windows 10 CRT files | |
238 "$root_out_dir/api-ms-win-core-console-l1-1-0.dll", | |
239 "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll", | |
240 "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll", | |
241 "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll", | |
242 "$root_out_dir/api-ms-win-core-file-l1-1-0.dll", | |
243 "$root_out_dir/api-ms-win-core-file-l1-2-0.dll", | |
244 "$root_out_dir/api-ms-win-core-file-l2-1-0.dll", | |
245 "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll", | |
246 "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll", | |
247 "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll", | |
248 "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll", | |
249 "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll", | |
250 "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll", | |
251 "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll", | |
252 "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll", | |
253 "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll", | |
254 "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll", | |
255 "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll", | |
256 "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll", | |
257 "$root_out_dir/api-ms-win-core-string-l1-1-0.dll", | |
258 "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll", | |
259 "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll", | |
260 "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll", | |
261 "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll", | |
262 "$root_out_dir/api-ms-win-core-util-l1-1-0.dll", | |
263 "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll", | |
264 "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll", | |
265 "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll", | |
266 "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll", | |
267 "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll", | |
268 "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll", | |
269 "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll", | |
270 "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll", | |
271 "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll", | |
272 "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll", | |
273 "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll", | |
274 "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll", | |
275 "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll", | |
276 "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll", | |
277 "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll", | |
278 "$root_out_dir/ucrtbase${vcrt_suffix}.dll", | |
279 ] | |
280 if (is_asan) { | |
281 if (current_cpu == "x64") { | |
282 data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_r
t.asan_dynamic-x86_64.dll" ] | |
283 } else { | |
284 data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_r
t.asan_dynamic-i386.dll" ] | |
285 } | |
286 } | |
287 } | |
288 if (is_nacl) { | |
289 deps += [ "//native_client_sdk/src/libraries/nacl_io" ] | |
290 } | |
291 } | 52 } |
292 | 53 |
293 config("enable_libevent_config") { | 54 group("rtc_task_queue") { |
294 defines = [ "WEBRTC_BUILD_LIBEVENT" ] | 55 public_deps = [ "../rtc_base:rtc_task_queue" ] |
295 } | 56 } |
296 | 57 |
297 rtc_static_library("rtc_task_queue") { | 58 group("sequenced_task_checker") { |
298 public_deps = [ | 59 public_deps = [ "../rtc_base:sequenced_task_checker" ] |
299 ":rtc_base_approved", | |
300 ] | |
301 | |
302 if (build_with_chromium) { | |
303 sources = [ | |
304 "../../webrtc_overrides/webrtc/base/task_queue.cc", | |
305 "../../webrtc_overrides/webrtc/base/task_queue.h", | |
306 ] | |
307 } else { | |
308 sources = [ | |
309 "task_queue.h", | |
310 "task_queue_posix.h", | |
311 ] | |
312 if (rtc_build_libevent) { | |
313 deps = [ | |
314 "//base/third_party/libevent", | |
315 ] | |
316 } | |
317 | |
318 if (rtc_enable_libevent) { | |
319 sources += [ | |
320 "task_queue_libevent.cc", | |
321 "task_queue_posix.cc", | |
322 ] | |
323 all_dependent_configs = [ ":enable_libevent_config" ] | |
324 } else { | |
325 if (is_mac || is_ios) { | |
326 sources += [ | |
327 "task_queue_gcd.cc", | |
328 "task_queue_posix.cc", | |
329 ] | |
330 } | |
331 if (is_win) { | |
332 sources += [ "task_queue_win.cc" ] | |
333 } | |
334 } | |
335 } | |
336 } | 60 } |
337 | 61 |
338 rtc_static_library("sequenced_task_checker") { | 62 group("weak_ptr") { |
339 sources = [ | 63 public_deps = [ "../rtc_base:weak_ptr" ] |
340 "sequenced_task_checker.h", | |
341 "sequenced_task_checker_impl.cc", | |
342 "sequenced_task_checker_impl.h", | |
343 ] | |
344 deps = [ | |
345 ":rtc_task_queue", | |
346 ] | |
347 } | 64 } |
348 | 65 |
349 rtc_static_library("weak_ptr") { | 66 group("rtc_numerics") { |
350 sources = [ | 67 public_deps = [ "../rtc_base:rtc_numerics" ] |
351 "weak_ptr.cc", | |
352 "weak_ptr.h", | |
353 ] | |
354 deps = [ | |
355 ":rtc_base_approved", | |
356 ":sequenced_task_checker", | |
357 ] | |
358 } | 68 } |
359 | 69 |
360 rtc_static_library("rtc_numerics") { | 70 group("rtc_json") { |
361 sources = [ | 71 public_deps = [ "../rtc_base:rtc_json" ] |
362 "numerics/exp_filter.cc", | |
363 "numerics/exp_filter.h", | |
364 "numerics/percentile_filter.h", | |
365 ] | |
366 deps = [ | |
367 ":rtc_base_approved", | |
368 ] | |
369 } | 72 } |
370 | 73 |
371 config("rtc_base_warnings_config") { | 74 group("rtc_base") { |
372 if (is_win && is_clang) { | 75 public_deps = [ "../rtc_base:rtc_base" ] |
373 cflags = [ | |
374 # Disable warnings failing when compiling with Clang on Windows. | |
375 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 | |
376 "-Wno-sign-compare", | |
377 "-Wno-missing-braces", | |
378 ] | |
379 } | |
380 } | 76 } |
381 | 77 |
382 rtc_source_set("rtc_json") { | 78 group("gtest_prod") { |
383 defines = [] | 79 public_deps = [ "../rtc_base:gtest_prod" ] |
384 sources = [ | |
385 "json.cc", | |
386 "json.h", | |
387 ] | |
388 if (rtc_build_json) { | |
389 public_deps = [ | |
390 "//third_party/jsoncpp", | |
391 ] | |
392 } else { | |
393 include_dirs = [ "$rtc_jsoncpp_root" ] | |
394 | |
395 # When defined changes the include path for json.h to where it is | |
396 # expected to be when building json outside of the standalone build. | |
397 defines += [ "WEBRTC_EXTERNAL_JSON" ] | |
398 } | |
399 } | 80 } |
400 | 81 |
401 rtc_static_library("rtc_base") { | 82 group("rtc_base_tests_utils") { |
402 cflags = [] | |
403 cflags_cc = [] | |
404 libs = [] | |
405 defines = [] | |
406 deps = [ | |
407 "..:webrtc_common", | |
408 ] | |
409 public_deps = [ | |
410 ":rtc_base_approved", | |
411 ] | |
412 public_configs = [] | |
413 | |
414 all_dependent_configs = [ ":rtc_base_all_dependent_config" ] | |
415 | |
416 sources = [ | |
417 "applefilesystem.mm", | |
418 "asyncinvoker-inl.h", | |
419 "asyncinvoker.cc", | |
420 "asyncinvoker.h", | |
421 "asyncpacketsocket.cc", | |
422 "asyncpacketsocket.h", | |
423 "asyncresolverinterface.cc", | |
424 "asyncresolverinterface.h", | |
425 "asyncsocket.cc", | |
426 "asyncsocket.h", | |
427 "asynctcpsocket.cc", | |
428 "asynctcpsocket.h", | |
429 "asyncudpsocket.cc", | |
430 "asyncudpsocket.h", | |
431 "crc32.cc", | |
432 "crc32.h", | |
433 "cryptstring.cc", | |
434 "cryptstring.h", | |
435 "filerotatingstream.cc", | |
436 "filerotatingstream.h", | |
437 "fileutils.cc", | |
438 "fileutils.h", | |
439 "gunit_prod.h", | |
440 "helpers.cc", | |
441 "helpers.h", | |
442 "httpbase.cc", | |
443 "httpbase.h", | |
444 "httpcommon-inl.h", | |
445 "httpcommon.cc", | |
446 "httpcommon.h", | |
447 "ipaddress.cc", | |
448 "ipaddress.h", | |
449 "messagedigest.cc", | |
450 "messagedigest.h", | |
451 "messagehandler.cc", | |
452 "messagehandler.h", | |
453 "messagequeue.cc", | |
454 "messagequeue.h", | |
455 "nethelpers.cc", | |
456 "nethelpers.h", | |
457 "network.cc", | |
458 "network.h", | |
459 "networkmonitor.cc", | |
460 "networkmonitor.h", | |
461 "nullsocketserver.cc", | |
462 "nullsocketserver.h", | |
463 "openssl.h", | |
464 "openssladapter.cc", | |
465 "openssladapter.h", | |
466 "openssldigest.cc", | |
467 "openssldigest.h", | |
468 "opensslidentity.cc", | |
469 "opensslidentity.h", | |
470 "opensslstreamadapter.cc", | |
471 "opensslstreamadapter.h", | |
472 "physicalsocketserver.cc", | |
473 "physicalsocketserver.h", | |
474 "proxyinfo.cc", | |
475 "proxyinfo.h", | |
476 "ratelimiter.cc", | |
477 "ratelimiter.h", | |
478 "rtccertificate.cc", | |
479 "rtccertificate.h", | |
480 "rtccertificategenerator.cc", | |
481 "rtccertificategenerator.h", | |
482 "signalthread.cc", | |
483 "signalthread.h", | |
484 "sigslot.cc", | |
485 "sigslot.h", | |
486 "socket.h", | |
487 "socketadapters.cc", | |
488 "socketadapters.h", | |
489 "socketaddress.cc", | |
490 "socketaddress.h", | |
491 "socketaddresspair.cc", | |
492 "socketaddresspair.h", | |
493 "socketfactory.h", | |
494 "socketserver.h", | |
495 "socketstream.cc", | |
496 "socketstream.h", | |
497 "ssladapter.cc", | |
498 "ssladapter.h", | |
499 "sslfingerprint.cc", | |
500 "sslfingerprint.h", | |
501 "sslidentity.cc", | |
502 "sslidentity.h", | |
503 "sslstreamadapter.cc", | |
504 "sslstreamadapter.h", | |
505 "stream.cc", | |
506 "stream.h", | |
507 "thread.cc", | |
508 "thread.h", | |
509 ] | |
510 | |
511 # TODO(henrike): issue 3307, make rtc_base build with the Chromium default | |
512 # compiler settings. | |
513 suppressed_configs += [ "//build/config/compiler:chromium_code" ] | |
514 configs += [ "//build/config/compiler:no_chromium_code" ] | |
515 if (!is_win) { | |
516 cflags += [ "-Wno-uninitialized" ] | |
517 } | |
518 | |
519 if (build_with_chromium) { | |
520 if (is_win) { | |
521 sources += [ "../../webrtc_overrides/webrtc/base/win32socketinit.cc" ] | |
522 } | |
523 include_dirs = [ "../../boringssl/src/include" ] | |
524 public_configs += [ ":rtc_base_chromium_config" ] | |
525 } else { | |
526 configs += [ ":rtc_base_warnings_config" ] | |
527 sources += [ | |
528 "callback.h", | |
529 "logsinks.cc", | |
530 "logsinks.h", | |
531 "mathutils.h", | |
532 "optionsfile.cc", | |
533 "optionsfile.h", | |
534 "rollingaccumulator.h", | |
535 "sslroots.h", | |
536 "transformadapter.cc", | |
537 "transformadapter.h", | |
538 "window.h", | |
539 ] | |
540 | |
541 if (is_win) { | |
542 sources += [ | |
543 "win32socketinit.cc", | |
544 "win32socketinit.h", | |
545 "win32socketserver.cc", | |
546 "win32socketserver.h", | |
547 ] | |
548 } | |
549 } # !build_with_chromium | |
550 | |
551 if (rtc_build_ssl) { | |
552 deps += [ "//third_party/boringssl" ] | |
553 } else { | |
554 configs += [ ":external_ssl_library" ] | |
555 } | |
556 | |
557 if (is_android) { | |
558 sources += [ | |
559 "ifaddrs-android.cc", | |
560 "ifaddrs-android.h", | |
561 ] | |
562 | |
563 libs += [ | |
564 "log", | |
565 "GLESv2", | |
566 ] | |
567 } | |
568 | |
569 if (is_ios || is_mac) { | |
570 sources += [ | |
571 "macifaddrs_converter.cc", | |
572 "thread_darwin.mm", | |
573 ] | |
574 } | |
575 | |
576 if (use_x11) { | |
577 libs += [ | |
578 "dl", | |
579 "rt", | |
580 "Xext", | |
581 "X11", | |
582 "Xcomposite", | |
583 "Xrender", | |
584 ] | |
585 } | |
586 | |
587 if (is_linux) { | |
588 libs += [ | |
589 "dl", | |
590 "rt", | |
591 ] | |
592 } | |
593 | |
594 if (is_mac) { | |
595 sources += [ | |
596 "macutils.cc", | |
597 "macutils.h", | |
598 ] | |
599 libs += [ | |
600 # For ProcessInformationCopyDictionary in unixfilesystem.cc. | |
601 "ApplicationServices.framework", | |
602 ] | |
603 } | |
604 | |
605 if (is_win) { | |
606 sources += [ | |
607 "win32.cc", | |
608 "win32.h", | |
609 "win32filesystem.cc", | |
610 "win32filesystem.h", | |
611 "win32securityerrors.cc", | |
612 "win32window.cc", | |
613 "win32window.h", | |
614 ] | |
615 | |
616 libs += [ | |
617 "crypt32.lib", | |
618 "iphlpapi.lib", | |
619 "secur32.lib", | |
620 ] | |
621 | |
622 cflags += [ | |
623 # Suppress warnings about WIN32_LEAN_AND_MEAN. | |
624 "/wd4005", | |
625 "/wd4703", | |
626 ] | |
627 | |
628 defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ] | |
629 } | |
630 | |
631 if (is_posix) { | |
632 sources += [ | |
633 "ifaddrs_converter.cc", | |
634 "ifaddrs_converter.h", | |
635 "unixfilesystem.cc", | |
636 "unixfilesystem.h", | |
637 ] | |
638 } | |
639 | |
640 if (is_nacl) { | |
641 deps += [ "//native_client_sdk/src/libraries/nacl_io" ] | |
642 defines += [ "timezone=_timezone" ] | |
643 sources -= [ "ifaddrs_converter.cc" ] | |
644 } | |
645 if (is_win && is_clang) { | |
646 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
647 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
648 } | |
649 } | |
650 | |
651 rtc_source_set("gtest_prod") { | |
652 sources = [ | |
653 "gtest_prod_util.h", | |
654 ] | |
655 } | |
656 | |
657 config("rtc_base_tests_utils_exported_config") { | |
658 defines = [ "GTEST_RELATIVE_PATH" ] | |
659 } | |
660 | |
661 config("rtc_base_tests_utils_warnings_config") { | |
662 if (is_win && is_clang) { | |
663 cflags = [ | |
664 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270 | |
665 "-Wno-reorder", | |
666 "-Wno-sign-compare", | |
667 ] | |
668 } | |
669 } | |
670 | |
671 rtc_source_set("rtc_base_tests_utils") { | |
672 testonly = true | 83 testonly = true |
673 sources = [ | 84 public_deps = [ "../rtc_base:rtc_base_tests_utils" ] |
674 # Also use this as a convenient dumping ground for misc files that are | |
675 # included by multiple targets below. | |
676 "cpu_time.cc", | |
677 "cpu_time.h", | |
678 "fakeclock.cc", | |
679 "fakeclock.h", | |
680 "fakenetwork.h", | |
681 "fakesslidentity.h", | |
682 "firewallsocketserver.cc", | |
683 "firewallsocketserver.h", | |
684 "gunit.h", | |
685 "httpserver.cc", | |
686 "httpserver.h", | |
687 "md5.cc", | |
688 "md5.h", | |
689 "md5digest.cc", | |
690 "md5digest.h", | |
691 "memory_usage.cc", | |
692 "memory_usage.h", | |
693 "natserver.cc", | |
694 "natserver.h", | |
695 "natsocketfactory.cc", | |
696 "natsocketfactory.h", | |
697 "nattypes.cc", | |
698 "nattypes.h", | |
699 "proxyserver.cc", | |
700 "proxyserver.h", | |
701 "sha1.cc", | |
702 "sha1.h", | |
703 "sha1digest.cc", | |
704 "sha1digest.h", | |
705 "sigslottester.h", | |
706 "sigslottester.h.pump", | |
707 "testbase64.h", | |
708 "testclient.cc", | |
709 "testclient.h", | |
710 "testechoserver.h", | |
711 "testutils.h", | |
712 "timedelta.h", | |
713 "virtualsocketserver.cc", | |
714 "virtualsocketserver.h", | |
715 ] | |
716 configs += [ ":rtc_base_tests_utils_warnings_config" ] | |
717 public_configs = [ ":rtc_base_tests_utils_exported_config" ] | |
718 deps = [ | |
719 ":rtc_base", | |
720 "../test:field_trial", | |
721 "../test:test_support", | |
722 ] | |
723 public_deps = [ | |
724 "//testing/gmock", | |
725 "//testing/gtest", | |
726 ] | |
727 | |
728 if (!build_with_chromium && is_clang) { | |
729 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
730 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
731 } | |
732 } | 85 } |
733 | 86 |
734 if (rtc_include_tests) { | 87 if (rtc_include_tests) { |
735 rtc_source_set("rtc_base_tests_main") { | 88 group("rtc_base_tests_main") { |
736 testonly = true | 89 testonly = true |
737 sources = [ | 90 public_deps = [ "../rtc_base:rtc_base_tests_main" ] |
738 "unittest_main.cc", | |
739 ] | |
740 public_configs = [ ":rtc_base_tests_utils_exported_config" ] | |
741 deps = [ | |
742 ":rtc_base", | |
743 ":rtc_base_approved", | |
744 ":rtc_base_tests_utils", | |
745 "../test:field_trial", | |
746 "../test:test_support", | |
747 ] | |
748 | |
749 public_deps = [ | |
750 "//testing/gmock", | |
751 "//testing/gtest", | |
752 ] | |
753 | |
754 if (!build_with_chromium && is_clang) { | |
755 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
756 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
757 } | |
758 } | 91 } |
759 | 92 |
760 rtc_source_set("rtc_base_nonparallel_tests") { | 93 group("rtc_base_nonparallel_tests") { |
761 testonly = true | 94 testonly = true |
762 | 95 public_deps = [ "../rtc_base:rtc_base_nonparallel_tests" ] |
763 # Skip restricting visibility on mobile platforms since the tests on those | |
764 # gets additional generated targets which would require many lines here to | |
765 # cover (which would be confusing to read and hard to maintain). | |
766 if (!is_android && !is_ios) { | |
767 visibility = [ "//webrtc:webrtc_nonparallel_tests" ] | |
768 } | |
769 sources = [ | |
770 "cpu_time_unittest.cc", | |
771 "filerotatingstream_unittest.cc", | |
772 "nullsocketserver_unittest.cc", | |
773 "physicalsocketserver_unittest.cc", | |
774 "socket_unittest.cc", | |
775 "socket_unittest.h", | |
776 "socketaddress_unittest.cc", | |
777 ] | |
778 deps = [ | |
779 ":rtc_base", | |
780 ":rtc_base_tests_main", | |
781 ":rtc_base_tests_utils", | |
782 "../system_wrappers:system_wrappers", | |
783 "../test:test_support", | |
784 "//testing/gtest", | |
785 ] | |
786 if (is_win) { | |
787 sources += [ "win32socketserver_unittest.cc" ] | |
788 } | |
789 | |
790 if (!build_with_chromium && is_clang) { | |
791 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
792 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
793 } | |
794 } | 96 } |
795 | 97 |
796 rtc_source_set("rtc_base_approved_unittests") { | 98 group("rtc_base_approved_unittests") { |
797 testonly = true | 99 testonly = true |
798 | 100 public_deps = [ "../rtc_base:rtc_base_approved_unittests" ] |
799 # Skip restricting visibility on mobile platforms since the tests on those | |
800 # gets additional generated targets which would require many lines here to | |
801 # cover (which would be confusing to read and hard to maintain). | |
802 if (!is_android && !is_ios) { | |
803 visibility = [ "//webrtc:rtc_unittests" ] | |
804 } | |
805 sources = [ | |
806 "array_view_unittest.cc", | |
807 "atomicops_unittest.cc", | |
808 "base64_unittest.cc", | |
809 "basictypes_unittest.cc", | |
810 "bind_unittest.cc", | |
811 "bitbuffer_unittest.cc", | |
812 "buffer_unittest.cc", | |
813 "bufferqueue_unittest.cc", | |
814 "bytebuffer_unittest.cc", | |
815 "byteorder_unittest.cc", | |
816 "copyonwritebuffer_unittest.cc", | |
817 "criticalsection_unittest.cc", | |
818 "event_tracer_unittest.cc", | |
819 "event_unittest.cc", | |
820 "file_unittest.cc", | |
821 "function_view_unittest.cc", | |
822 "logging_unittest.cc", | |
823 "md5digest_unittest.cc", | |
824 "mod_ops_unittest.cc", | |
825 "onetimeevent_unittest.cc", | |
826 "optional_unittest.cc", | |
827 "pathutils_unittest.cc", | |
828 "platform_thread_unittest.cc", | |
829 "random_unittest.cc", | |
830 "rate_limiter_unittest.cc", | |
831 "rate_statistics_unittest.cc", | |
832 "ratetracker_unittest.cc", | |
833 "refcountedobject_unittest.cc", | |
834 "safe_compare_unittest.cc", | |
835 "safe_minmax_unittest.cc", | |
836 "string_to_number_unittest.cc", | |
837 "stringencode_unittest.cc", | |
838 "stringize_macros_unittest.cc", | |
839 "stringutils_unittest.cc", | |
840 "swap_queue_unittest.cc", | |
841 "thread_annotations_unittest.cc", | |
842 "thread_checker_unittest.cc", | |
843 "timestampaligner_unittest.cc", | |
844 "timeutils_unittest.cc", | |
845 "virtualsocket_unittest.cc", | |
846 ] | |
847 deps = [ | |
848 ":rtc_base", | |
849 ":rtc_base_approved", | |
850 ":rtc_base_tests_main", | |
851 ":rtc_base_tests_utils", | |
852 ":rtc_task_queue", | |
853 "../system_wrappers:system_wrappers", | |
854 "../test:test_support", | |
855 ] | |
856 if (!build_with_chromium && is_clang) { | |
857 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
858 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
859 } | |
860 } | 101 } |
861 | 102 |
862 rtc_source_set("rtc_task_queue_unittests") { | 103 group("sequenced_task_checker_unittests") { |
863 testonly = true | 104 testonly = true |
864 | 105 public_deps = [ "../rtc_base:sequenced_task_checker_unittests" ] |
865 # Skip restricting visibility on mobile platforms since the tests on those | |
866 # gets additional generated targets which would require many lines here to | |
867 # cover (which would be confusing to read and hard to maintain). | |
868 if (!is_android && !is_ios) { | |
869 visibility = [ "//webrtc:rtc_unittests" ] | |
870 } | |
871 sources = [ | |
872 "task_queue_unittest.cc", | |
873 ] | |
874 deps = [ | |
875 ":rtc_base_tests_main", | |
876 ":rtc_base_tests_utils", | |
877 ":rtc_task_queue", | |
878 "../test:test_support", | |
879 ] | |
880 if (!build_with_chromium && is_clang) { | |
881 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
882 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
883 } | |
884 } | 106 } |
885 | 107 |
886 rtc_source_set("sequenced_task_checker_unittests") { | 108 group("weak_ptr_unittests") { |
887 testonly = true | 109 testonly = true |
888 | 110 public_deps = [ "../rtc_base:weak_ptr_unittests" ] |
889 # Skip restricting visibility on mobile platforms since the tests on those | |
890 # gets additional generated targets which would require many lines here to | |
891 # cover (which would be confusing to read and hard to maintain). | |
892 if (!is_android && !is_ios) { | |
893 visibility = [ "//webrtc:rtc_unittests" ] | |
894 } | |
895 sources = [ | |
896 "sequenced_task_checker_unittest.cc", | |
897 ] | |
898 deps = [ | |
899 ":rtc_base_approved", | |
900 ":rtc_base_tests_main", | |
901 ":rtc_task_queue", | |
902 ":sequenced_task_checker", | |
903 "../test:test_support", | |
904 ] | |
905 } | 111 } |
906 | 112 |
907 rtc_source_set("weak_ptr_unittests") { | 113 group("rtc_task_queue_unittests") { |
908 testonly = true | 114 testonly = true |
909 | 115 public_deps = [ "../rtc_base:rtc_task_queue_unittests" ] |
910 # Skip restricting visibility on mobile platforms since the tests on those | |
911 # gets additional generated targets which would require many lines here to | |
912 # cover (which would be confusing to read and hard to maintain). | |
913 if (!is_android && !is_ios) { | |
914 visibility = [ "//webrtc:rtc_unittests" ] | |
915 } | |
916 sources = [ | |
917 "weak_ptr_unittest.cc", | |
918 ] | |
919 deps = [ | |
920 ":rtc_base_tests_main", | |
921 ":rtc_base_tests_utils", | |
922 ":rtc_task_queue", | |
923 ":weak_ptr", | |
924 "../test:test_support", | |
925 ] | |
926 } | 116 } |
927 | 117 |
928 rtc_source_set("rtc_numerics_unittests") { | 118 |
| 119 group("rtc_numerics_unittests") { |
929 testonly = true | 120 testonly = true |
930 | 121 public_deps = [ "../rtc_base:rtc_numerics_unittests" ] |
931 # Skip restricting visibility on mobile platforms since the tests on those | |
932 # gets additional generated targets which would require many lines here to | |
933 # cover (which would be confusing to read and hard to maintain). | |
934 if (!is_android && !is_ios) { | |
935 visibility = [ "//webrtc:rtc_unittests" ] | |
936 } | |
937 sources = [ | |
938 "numerics/exp_filter_unittest.cc", | |
939 "numerics/percentile_filter_unittest.cc", | |
940 ] | |
941 deps = [ | |
942 ":rtc_base_approved", | |
943 ":rtc_base_tests_main", | |
944 ":rtc_numerics", | |
945 "../test:test_support", | |
946 ] | |
947 } | 122 } |
948 | 123 |
949 config("rtc_base_unittests_config") { | 124 group("rtc_base_unittests") { |
950 if (is_clang) { | |
951 cflags = [ "-Wno-unused-const-variable" ] | |
952 } | |
953 } | |
954 rtc_source_set("rtc_base_unittests") { | |
955 testonly = true | 125 testonly = true |
956 | 126 public_deps = [ "../rtc_base:rtc_base_unittests" ] |
957 # Skip restricting visibility on mobile platforms since the tests on those | |
958 # gets additional generated targets which would require many lines here to | |
959 # cover (which would be confusing to read and hard to maintain). | |
960 if (!is_android && !is_ios) { | |
961 visibility = [ "//webrtc:rtc_unittests" ] | |
962 } | |
963 sources = [ | |
964 "callback_unittest.cc", | |
965 "crc32_unittest.cc", | |
966 "fileutils_unittest.cc", | |
967 "helpers_unittest.cc", | |
968 "httpbase_unittest.cc", | |
969 "httpcommon_unittest.cc", | |
970 "httpserver_unittest.cc", | |
971 "ipaddress_unittest.cc", | |
972 "memory_usage_unittest.cc", | |
973 "messagedigest_unittest.cc", | |
974 "messagequeue_unittest.cc", | |
975 "nat_unittest.cc", | |
976 "network_unittest.cc", | |
977 "optionsfile_unittest.cc", | |
978 "proxy_unittest.cc", | |
979 "ptr_util_unittest.cc", | |
980 "ratelimiter_unittest.cc", | |
981 "rollingaccumulator_unittest.cc", | |
982 "rtccertificate_unittest.cc", | |
983 "rtccertificategenerator_unittest.cc", | |
984 "sha1digest_unittest.cc", | |
985 "signalthread_unittest.cc", | |
986 "sigslot_unittest.cc", | |
987 "sigslottester_unittest.cc", | |
988 "stream_unittest.cc", | |
989 "testclient_unittest.cc", | |
990 "thread_unittest.cc", | |
991 ] | |
992 if (is_win) { | |
993 sources += [ | |
994 "win32_unittest.cc", | |
995 "win32window_unittest.cc", | |
996 ] | |
997 } | |
998 if (is_mac) { | |
999 sources += [ "macutils_unittest.cc" ] | |
1000 } | |
1001 if (is_posix) { | |
1002 sources += [ | |
1003 "ssladapter_unittest.cc", | |
1004 "sslidentity_unittest.cc", | |
1005 "sslstreamadapter_unittest.cc", | |
1006 ] | |
1007 } | |
1008 deps = [ | |
1009 ":rtc_base_tests_main", | |
1010 ":rtc_base_tests_utils", | |
1011 "../test:test_support", | |
1012 ] | |
1013 public_deps = [ | |
1014 ":rtc_base", | |
1015 ] | |
1016 configs += [ ":rtc_base_unittests_config" ] | |
1017 if (!build_with_chromium && is_clang) { | |
1018 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
1019 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
1020 } | |
1021 } | 127 } |
1022 } | 128 } |
1023 | 129 |
1024 if (is_android) { | 130 if (is_android) { |
1025 android_library("base_java") { | 131 android_library("base_java") { |
1026 java_files = [ | 132 java_files = [ "Dummy.java" ] # Need one file to avoid hitting an assert. |
1027 "java/src/org/webrtc/ContextUtils.java", | 133 deps = [ "../rtc_base:base_java" ] |
1028 "java/src/org/webrtc/Logging.java", | |
1029 "java/src/org/webrtc/Size.java", | |
1030 "java/src/org/webrtc/ThreadUtils.java", | |
1031 ] | |
1032 } | 134 } |
1033 } | 135 } |
OLD | NEW |