You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1378 lines
30 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
  2. #
  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
  5. # tree. An additional intellectual property rights grant can be found
  6. # in the file PATENTS. All contributing project authors may
  7. # be found in the AUTHORS file in the root of the source tree.
  8. import("//build/config/crypto.gni")
  9. import("//build/config/ui.gni")
  10. import("../webrtc.gni")
  11. if (is_android) {
  12. import("//build/config/android/config.gni")
  13. import("//build/config/android/rules.gni")
  14. }
  15. config("rtc_base_chromium_config") {
  16. defines = [ "NO_MAIN_THREAD_WRAPPING" ]
  17. }
  18. if (!rtc_build_ssl) {
  19. config("external_ssl_library") {
  20. assert(rtc_ssl_root != "",
  21. "You must specify rtc_ssl_root when rtc_build_ssl==0.")
  22. include_dirs = [ rtc_ssl_root ]
  23. }
  24. }
  25. rtc_source_set("protobuf_utils") {
  26. sources = [
  27. "protobuf_utils.h",
  28. ]
  29. if (rtc_enable_protobuf) {
  30. public_configs = [ "//third_party/protobuf:protobuf_config" ]
  31. deps = [
  32. "//third_party/protobuf:protobuf_lite",
  33. ]
  34. }
  35. }
  36. rtc_source_set("compile_assert_c") {
  37. sources = [
  38. "compile_assert_c.h",
  39. ]
  40. }
  41. rtc_source_set("ignore_wundef") {
  42. sources = [
  43. "ignore_wundef.h",
  44. ]
  45. }
  46. # The subset of rtc_base approved for use outside of libjingle.
  47. # TODO(bugs.webrtc.org/9838): Create small and focused build targets and remove
  48. # the old concept of rtc_base and rtc_base_approved.
  49. rtc_library("rtc_base_approved") {
  50. visibility = [ "*" ]
  51. deps = [
  52. ":checks",
  53. ":rtc_task_queue",
  54. ":safe_compare",
  55. ":type_traits",
  56. "../api:array_view",
  57. "../api:scoped_refptr",
  58. "system:arch",
  59. "system:rtc_export",
  60. "system:unused",
  61. "third_party/base64",
  62. "//third_party/abseil-cpp/absl/types:optional",
  63. ]
  64. public_deps = [] # no-presubmit-check TODO(webrtc:8603)
  65. sources = [
  66. "bind.h",
  67. "bit_buffer.cc",
  68. "bit_buffer.h",
  69. "buffer.h",
  70. "buffer_queue.cc",
  71. "buffer_queue.h",
  72. "byte_buffer.cc",
  73. "byte_buffer.h",
  74. "byte_order.h",
  75. "copy_on_write_buffer.cc",
  76. "copy_on_write_buffer.h",
  77. "event_tracer.cc",
  78. "event_tracer.h",
  79. "location.cc",
  80. "location.h",
  81. "message_buffer_reader.h",
  82. "numerics/histogram_percentile_counter.cc",
  83. "numerics/histogram_percentile_counter.h",
  84. "numerics/mod_ops.h",
  85. "numerics/moving_max_counter.h",
  86. "numerics/sample_counter.cc",
  87. "numerics/sample_counter.h",
  88. "one_time_event.h",
  89. "race_checker.cc",
  90. "race_checker.h",
  91. "random.cc",
  92. "random.h",
  93. "rate_statistics.cc",
  94. "rate_statistics.h",
  95. "rate_tracker.cc",
  96. "rate_tracker.h",
  97. "swap_queue.h",
  98. "template_util.h",
  99. "timestamp_aligner.cc",
  100. "timestamp_aligner.h",
  101. "trace_event.h",
  102. "zero_memory.cc",
  103. "zero_memory.h",
  104. ]
  105. if (is_win) {
  106. sources += [
  107. "win/windows_version.cc",
  108. "win/windows_version.h",
  109. ]
  110. data_deps = [
  111. "//build/win:runtime_libs",
  112. ]
  113. }
  114. if (is_nacl) {
  115. public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] # no-presubmit-check TODO(webrtc:8603)
  116. }
  117. if (is_android) {
  118. libs = [ "log" ]
  119. }
  120. public_deps += [ # no-presubmit-check TODO(webrtc:8603)
  121. ":atomicops",
  122. ":criticalsection",
  123. ":logging",
  124. ":macromagic",
  125. ":platform_thread",
  126. ":platform_thread_types",
  127. ":refcount",
  128. ":rtc_event",
  129. ":safe_conversions",
  130. ":stringutils",
  131. ":thread_checker",
  132. ":timeutils",
  133. ]
  134. }
  135. rtc_source_set("macromagic") {
  136. # TODO(bugs.webrtc.org/9606): This should not be public.
  137. visibility = [ "*" ]
  138. sources = [
  139. "arraysize.h",
  140. "constructor_magic.h",
  141. "format_macros.h",
  142. "stringize_macros.h",
  143. "thread_annotations.h",
  144. ]
  145. deps = [
  146. "system:arch",
  147. ]
  148. }
  149. rtc_library("platform_thread_types") {
  150. sources = [
  151. "platform_thread_types.cc",
  152. "platform_thread_types.h",
  153. ]
  154. }
  155. rtc_source_set("refcount") {
  156. visibility = [ "*" ]
  157. sources = [
  158. "ref_count.h",
  159. "ref_counted_object.h",
  160. "ref_counter.h",
  161. ]
  162. deps = [
  163. ":atomicops",
  164. ":macromagic",
  165. ]
  166. }
  167. rtc_library("criticalsection") {
  168. sources = [
  169. "critical_section.cc",
  170. "critical_section.h",
  171. ]
  172. deps = [
  173. ":atomicops",
  174. ":checks",
  175. ":macromagic",
  176. ":platform_thread_types",
  177. "system:rtc_export",
  178. "system:unused",
  179. ]
  180. }
  181. rtc_library("platform_thread") {
  182. visibility = [
  183. ":rtc_base_approved",
  184. ":rtc_task_queue_libevent",
  185. ":rtc_task_queue_win",
  186. ":rtc_task_queue_stdlib",
  187. "synchronization:sequence_checker",
  188. ]
  189. sources = [
  190. "platform_thread.cc",
  191. "platform_thread.h",
  192. ]
  193. deps = [
  194. ":atomicops",
  195. ":checks",
  196. ":macromagic",
  197. ":platform_thread_types",
  198. ":rtc_event",
  199. ":thread_checker",
  200. ":timeutils",
  201. "//third_party/abseil-cpp/absl/strings",
  202. ]
  203. }
  204. rtc_library("rtc_event") {
  205. if (build_with_chromium) {
  206. sources = [
  207. "../../webrtc_overrides/rtc_base/event.cc",
  208. "../../webrtc_overrides/rtc_base/event.h",
  209. ]
  210. deps = [
  211. ":checks",
  212. "//base", # Dependency on chromium's waitable_event.
  213. ]
  214. } else {
  215. sources = [
  216. "event.cc",
  217. "event.h",
  218. ]
  219. deps = [
  220. ":checks",
  221. "synchronization:yield_policy",
  222. "system:warn_current_thread_is_deadlocked",
  223. "//third_party/abseil-cpp/absl/types:optional",
  224. ]
  225. }
  226. }
  227. rtc_library("logging") {
  228. visibility = [ "*" ]
  229. libs = []
  230. deps = [
  231. ":checks",
  232. ":criticalsection",
  233. ":macromagic",
  234. ":platform_thread_types",
  235. ":stringutils",
  236. ":timeutils",
  237. "//third_party/abseil-cpp/absl/base:core_headers",
  238. "//third_party/abseil-cpp/absl/meta:type_traits",
  239. "//third_party/abseil-cpp/absl/strings",
  240. ]
  241. if (build_with_chromium) {
  242. # Dependency on chromium's logging (in //base).
  243. deps += [ "//base" ]
  244. sources = [
  245. "../../webrtc_overrides/rtc_base/logging.cc",
  246. "../../webrtc_overrides/rtc_base/logging.h",
  247. ]
  248. } else {
  249. configs += [
  250. "..:no_exit_time_destructors",
  251. "..:no_global_constructors",
  252. ]
  253. sources = [
  254. "logging.cc",
  255. "logging.h",
  256. ]
  257. deps += [ "system:inline" ]
  258. if (is_mac) {
  259. libs += [ "Foundation.framework" ]
  260. }
  261. # logging.h needs the deprecation header while downstream projects are
  262. # removing code that depends on logging implementation details.
  263. deps += [ ":deprecation" ]
  264. if (is_android) {
  265. libs += [ "log" ]
  266. }
  267. }
  268. }
  269. rtc_source_set("thread_checker") {
  270. sources = [
  271. "thread_checker.h",
  272. ]
  273. deps = [
  274. ":deprecation",
  275. "synchronization:sequence_checker",
  276. ]
  277. }
  278. rtc_source_set("atomicops") {
  279. sources = [
  280. "atomic_ops.h",
  281. ]
  282. }
  283. rtc_library("checks") {
  284. # TODO(bugs.webrtc.org/9607): This should not be public.
  285. visibility = [ "*" ]
  286. libs = []
  287. sources = [
  288. "checks.cc",
  289. "checks.h",
  290. ]
  291. deps = [
  292. ":safe_compare",
  293. "system:inline",
  294. "system:rtc_export",
  295. "//third_party/abseil-cpp/absl/meta:type_traits",
  296. "//third_party/abseil-cpp/absl/strings",
  297. ]
  298. if (is_android) {
  299. libs += [ "log" ]
  300. }
  301. }
  302. rtc_library("rate_limiter") {
  303. sources = [
  304. "rate_limiter.cc",
  305. "rate_limiter.h",
  306. ]
  307. deps = [
  308. ":rtc_base_approved",
  309. "../system_wrappers",
  310. "//third_party/abseil-cpp/absl/types:optional",
  311. ]
  312. }
  313. rtc_source_set("sanitizer") {
  314. sources = [
  315. "sanitizer.h",
  316. ]
  317. deps = [
  318. "//third_party/abseil-cpp/absl/meta:type_traits",
  319. ]
  320. }
  321. rtc_source_set("divide_round") {
  322. sources = [
  323. "numerics/divide_round.h",
  324. ]
  325. deps = [
  326. ":checks",
  327. ":safe_compare",
  328. ]
  329. }
  330. rtc_source_set("safe_compare") {
  331. sources = [
  332. "numerics/safe_compare.h",
  333. ]
  334. deps = [
  335. ":type_traits",
  336. ]
  337. }
  338. rtc_source_set("safe_minmax") {
  339. sources = [
  340. "numerics/safe_minmax.h",
  341. ]
  342. deps = [
  343. ":checks",
  344. ":safe_compare",
  345. ":type_traits",
  346. ]
  347. }
  348. rtc_source_set("safe_conversions") {
  349. sources = [
  350. "numerics/safe_conversions.h",
  351. "numerics/safe_conversions_impl.h",
  352. ]
  353. deps = [
  354. ":checks",
  355. ]
  356. }
  357. rtc_library("timeutils") {
  358. visibility = [ "*" ]
  359. sources = [
  360. "time_utils.cc",
  361. "time_utils.h",
  362. ]
  363. deps = [
  364. ":checks",
  365. ":safe_conversions",
  366. ":stringutils",
  367. "system:rtc_export",
  368. ]
  369. libs = []
  370. if (is_win) {
  371. libs += [ "winmm.lib" ]
  372. }
  373. }
  374. rtc_library("stringutils") {
  375. sources = [
  376. "string_encode.cc",
  377. "string_encode.h",
  378. "string_to_number.cc",
  379. "string_to_number.h",
  380. "string_utils.cc",
  381. "string_utils.h",
  382. "strings/string_builder.cc",
  383. "strings/string_builder.h",
  384. ]
  385. deps = [
  386. ":checks",
  387. ":macromagic",
  388. ":safe_minmax",
  389. "../api:array_view",
  390. "//third_party/abseil-cpp/absl/strings",
  391. "//third_party/abseil-cpp/absl/types:optional",
  392. ]
  393. }
  394. rtc_library("audio_format_to_string") {
  395. sources = [
  396. "strings/audio_format_to_string.cc",
  397. "strings/audio_format_to_string.h",
  398. ]
  399. deps = [
  400. ":stringutils",
  401. "../api/audio_codecs:audio_codecs_api",
  402. ]
  403. }
  404. rtc_source_set("type_traits") {
  405. sources = [
  406. "type_traits.h",
  407. ]
  408. }
  409. rtc_source_set("deprecation") {
  410. sources = [
  411. "deprecation.h",
  412. ]
  413. }
  414. rtc_library("rtc_task_queue") {
  415. visibility = [ "*" ]
  416. sources = [
  417. "task_queue.cc",
  418. "task_queue.h",
  419. ]
  420. deps = [
  421. ":macromagic",
  422. "../api/task_queue",
  423. "system:rtc_export",
  424. "task_utils:to_queued_task",
  425. "//third_party/abseil-cpp/absl/memory",
  426. ]
  427. }
  428. if (rtc_enable_libevent) {
  429. rtc_library("rtc_task_queue_libevent") {
  430. visibility = [ "../api/task_queue:default_task_queue_factory" ]
  431. sources = [
  432. "task_queue_libevent.cc",
  433. "task_queue_libevent.h",
  434. ]
  435. deps = [
  436. ":checks",
  437. ":criticalsection",
  438. ":logging",
  439. ":macromagic",
  440. ":platform_thread",
  441. ":platform_thread_types",
  442. ":safe_conversions",
  443. ":timeutils",
  444. "../api/task_queue",
  445. "//third_party/abseil-cpp/absl/strings",
  446. ]
  447. if (rtc_build_libevent) {
  448. deps += [ "//base/third_party/libevent" ]
  449. }
  450. }
  451. }
  452. if (is_mac || is_ios) {
  453. rtc_library("rtc_task_queue_gcd") {
  454. visibility = [ "../api/task_queue:default_task_queue_factory" ]
  455. sources = [
  456. "task_queue_gcd.cc",
  457. "task_queue_gcd.h",
  458. ]
  459. deps = [
  460. ":checks",
  461. ":logging",
  462. "../api/task_queue",
  463. "//third_party/abseil-cpp/absl/strings",
  464. ]
  465. }
  466. }
  467. if (is_win) {
  468. rtc_library("rtc_task_queue_win") {
  469. visibility = [ "../api/task_queue:default_task_queue_factory" ]
  470. sources = [
  471. "task_queue_win.cc",
  472. "task_queue_win.h",
  473. ]
  474. deps = [
  475. ":checks",
  476. ":criticalsection",
  477. ":logging",
  478. ":macromagic",
  479. ":platform_thread",
  480. ":rtc_event",
  481. ":safe_conversions",
  482. ":timeutils",
  483. "../api/task_queue",
  484. "//third_party/abseil-cpp/absl/strings",
  485. ]
  486. }
  487. }
  488. rtc_library("rtc_task_queue_stdlib") {
  489. sources = [
  490. "task_queue_stdlib.cc",
  491. "task_queue_stdlib.h",
  492. ]
  493. deps = [
  494. ":checks",
  495. ":criticalsection",
  496. ":logging",
  497. ":macromagic",
  498. ":platform_thread",
  499. ":rtc_event",
  500. ":safe_conversions",
  501. ":timeutils",
  502. "../api/task_queue",
  503. "//third_party/abseil-cpp/absl/strings",
  504. ]
  505. }
  506. rtc_library("weak_ptr") {
  507. sources = [
  508. "weak_ptr.cc",
  509. "weak_ptr.h",
  510. ]
  511. deps = [
  512. ":refcount",
  513. "../api:scoped_refptr",
  514. "synchronization:sequence_checker",
  515. ]
  516. }
  517. rtc_library("rtc_numerics") {
  518. sources = [
  519. "numerics/exp_filter.cc",
  520. "numerics/exp_filter.h",
  521. "numerics/math_utils.h",
  522. "numerics/moving_average.cc",
  523. "numerics/moving_average.h",
  524. "numerics/moving_median_filter.h",
  525. "numerics/percentile_filter.h",
  526. "numerics/running_statistics.h",
  527. "numerics/samples_stats_counter.cc",
  528. "numerics/samples_stats_counter.h",
  529. "numerics/sequence_number_util.h",
  530. ]
  531. deps = [
  532. ":checks",
  533. ":rtc_base_approved",
  534. ":safe_compare",
  535. "../api:array_view",
  536. "../api/units:timestamp",
  537. "//third_party/abseil-cpp/absl/algorithm:container",
  538. "//third_party/abseil-cpp/absl/types:optional",
  539. ]
  540. }
  541. config("rtc_json_suppressions") {
  542. if (!is_win || is_clang) {
  543. cflags_cc = [
  544. # TODO(bugs.webrtc.org/10770): Update jsoncpp API usage and remove
  545. # -Wno-deprecated-declarations.
  546. "-Wno-deprecated-declarations",
  547. # TODO(bugs.webrtc.org/10814): Remove -Wno-undef as soon as it get
  548. # removed upstream.
  549. "-Wno-undef",
  550. ]
  551. }
  552. }
  553. rtc_library("rtc_json") {
  554. public_configs = [ ":rtc_json_suppressions" ]
  555. defines = []
  556. sources = [
  557. "strings/json.cc",
  558. "strings/json.h",
  559. ]
  560. deps = [
  561. ":stringutils",
  562. ]
  563. all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
  564. if (rtc_build_json) {
  565. public_deps = [
  566. "//third_party/jsoncpp",
  567. ]
  568. } else {
  569. include_dirs = [ "$rtc_jsoncpp_root" ]
  570. # When defined changes the include path for json.h to where it is
  571. # expected to be when building json outside of the standalone build.
  572. defines += [ "WEBRTC_EXTERNAL_JSON" ]
  573. }
  574. }
  575. rtc_source_set("net_helpers") {
  576. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  577. # the following files:
  578. # sources = [
  579. # "net_helpers.cc",
  580. # "net_helpers.h",
  581. # ]
  582. }
  583. rtc_source_set("async_resolver_interface") {
  584. visibility = [ "*" ]
  585. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  586. # the following files:
  587. # sources = [
  588. # "async_resolver_interface.cc",
  589. # "async_resolver_interface.h",
  590. # ]
  591. }
  592. rtc_source_set("ip_address") {
  593. visibility = [ "*" ]
  594. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  595. # the following files:
  596. # sources = [
  597. # "ip_address.cc",
  598. # "ip_address.h",
  599. # ]
  600. }
  601. rtc_source_set("socket_address") {
  602. visibility = [ "*" ]
  603. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  604. # the following files:
  605. # sources = [
  606. # "socket_address.cc",
  607. # "socket_address.h",
  608. # ]
  609. }
  610. rtc_source_set("null_socket_server") {
  611. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  612. # the following files:
  613. # sources = [
  614. # "null_socket_server.cc",
  615. # "null_socket_server.h",
  616. # ]
  617. }
  618. rtc_source_set("socket_server") {
  619. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  620. # the following files:
  621. # sources = [
  622. # "socket_server.h",
  623. # ]
  624. }
  625. rtc_source_set("threading") {
  626. visibility = [ "*" ]
  627. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  628. # the following files:
  629. # sources = [
  630. # "asyncresolver.cc",
  631. # "asyncresolver.h",
  632. # "defaultsocketserver.cc",
  633. # "defaultsocketserver.h",
  634. # "message_handler.cc",
  635. # "message_handler.h",
  636. # "message_queue.cc",
  637. # "message_queue.h",
  638. # "network_monitor.cc",
  639. # "network_monitor.h",
  640. # "physical_socket_server.cc",
  641. # "physical_socket_server.h",
  642. # "signal_thread.cc",
  643. # "signal_thread.h",
  644. # "thread.cc",
  645. # "thread.h",
  646. # ]
  647. }
  648. rtc_source_set("socket_factory") {
  649. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  650. # the following files:
  651. # sources = [
  652. # "socket_factory.h",
  653. # ]
  654. }
  655. rtc_source_set("async_socket") {
  656. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  657. # the following files:
  658. # sources = [
  659. # "async_socket.cc",
  660. # "async_socket.h",
  661. # ]
  662. }
  663. rtc_source_set("socket") {
  664. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  665. # the following files:
  666. # sources = [
  667. # "socket.cc",
  668. # "socket.h",
  669. # ]
  670. }
  671. rtc_source_set("network_constants") {
  672. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  673. # the following files:
  674. # sources = [
  675. # "network_constants.h",
  676. # ]
  677. }
  678. if (is_android) {
  679. rtc_source_set("ifaddrs_android") {
  680. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  681. # the following files:
  682. # sources = [
  683. # "ifaddrs_android.cc",
  684. # "ifaddrs_android.h",
  685. # ]
  686. }
  687. }
  688. if (is_win) {
  689. rtc_source_set("win32") {
  690. # TODO(bugs.webrtc.org/9987): This build target will soon contain
  691. # the following files:
  692. # sources = [
  693. # "win32.cc",
  694. # "win32.h",
  695. # ]
  696. }
  697. }
  698. rtc_library("rtc_base") {
  699. visibility = [ "*" ]
  700. cflags = []
  701. cflags_cc = []
  702. libs = []
  703. defines = []
  704. deps = [
  705. ":checks",
  706. ":stringutils",
  707. "../api:array_view",
  708. "../api:scoped_refptr",
  709. "network:sent_packet",
  710. "system:file_wrapper",
  711. "system:rtc_export",
  712. "third_party/base64",
  713. "third_party/sigslot",
  714. "//third_party/abseil-cpp/absl/algorithm:container",
  715. "//third_party/abseil-cpp/absl/memory",
  716. "//third_party/abseil-cpp/absl/strings",
  717. "//third_party/abseil-cpp/absl/types:optional",
  718. ]
  719. public_deps = [
  720. ":rtc_base_approved",
  721. ]
  722. public_configs = []
  723. sources = [
  724. "async_invoker.cc",
  725. "async_invoker.h",
  726. "async_invoker_inl.h",
  727. "async_packet_socket.cc",
  728. "async_packet_socket.h",
  729. "async_resolver_interface.cc",
  730. "async_resolver_interface.h",
  731. "async_socket.cc",
  732. "async_socket.h",
  733. "async_tcp_socket.cc",
  734. "async_tcp_socket.h",
  735. "async_udp_socket.cc",
  736. "async_udp_socket.h",
  737. "crc32.cc",
  738. "crc32.h",
  739. "crypt_string.cc",
  740. "crypt_string.h",
  741. "data_rate_limiter.cc",
  742. "data_rate_limiter.h",
  743. "dscp.h",
  744. "file_rotating_stream.cc",
  745. "file_rotating_stream.h",
  746. "helpers.cc",
  747. "helpers.h",
  748. "http_common.cc",
  749. "http_common.h",
  750. "ip_address.cc",
  751. "ip_address.h",
  752. "keep_ref_until_done.h",
  753. "mdns_responder_interface.h",
  754. "message_digest.cc",
  755. "message_digest.h",
  756. "message_handler.cc",
  757. "message_handler.h",
  758. "message_queue.cc",
  759. "message_queue.h",
  760. "net_helper.cc",
  761. "net_helper.h",
  762. "net_helpers.cc",
  763. "net_helpers.h",
  764. "network.cc",
  765. "network.h",
  766. "network_constants.h",
  767. "network_monitor.cc",
  768. "network_monitor.h",
  769. "network_route.h",
  770. "null_socket_server.cc",
  771. "null_socket_server.h",
  772. "openssl.h",
  773. "openssl_adapter.cc",
  774. "openssl_adapter.h",
  775. "openssl_certificate.cc",
  776. "openssl_certificate.h",
  777. "openssl_digest.cc",
  778. "openssl_digest.h",
  779. "openssl_identity.cc",
  780. "openssl_identity.h",
  781. "openssl_session_cache.cc",
  782. "openssl_session_cache.h",
  783. "openssl_stream_adapter.cc",
  784. "openssl_stream_adapter.h",
  785. "openssl_utility.cc",
  786. "openssl_utility.h",
  787. "physical_socket_server.cc",
  788. "physical_socket_server.h",
  789. "proxy_info.cc",
  790. "proxy_info.h",
  791. "rtc_certificate.cc",
  792. "rtc_certificate.h",
  793. "rtc_certificate_generator.cc",
  794. "rtc_certificate_generator.h",
  795. "signal_thread.cc",
  796. "signal_thread.h",
  797. "sigslot_repeater.h",
  798. "socket.cc",
  799. "socket.h",
  800. "socket_adapters.cc",
  801. "socket_adapters.h",
  802. "socket_address.cc",
  803. "socket_address.h",
  804. "socket_address_pair.cc",
  805. "socket_address_pair.h",
  806. "socket_factory.h",
  807. "socket_server.h",
  808. "ssl_adapter.cc",
  809. "ssl_adapter.h",
  810. "ssl_certificate.cc",
  811. "ssl_certificate.h",
  812. "ssl_fingerprint.cc",
  813. "ssl_fingerprint.h",
  814. "ssl_identity.cc",
  815. "ssl_identity.h",
  816. "ssl_stream_adapter.cc",
  817. "ssl_stream_adapter.h",
  818. "stream.cc",
  819. "stream.h",
  820. "thread.cc",
  821. "thread.h",
  822. "unique_id_generator.cc",
  823. "unique_id_generator.h",
  824. ]
  825. if (build_with_chromium) {
  826. include_dirs = [ "../../boringssl/src/include" ]
  827. public_configs += [ ":rtc_base_chromium_config" ]
  828. } else {
  829. sources += [
  830. "callback.h",
  831. "log_sinks.cc",
  832. "log_sinks.h",
  833. "numerics/math_utils.h",
  834. "rolling_accumulator.h",
  835. "ssl_roots.h",
  836. ]
  837. deps += [ ":rtc_numerics" ]
  838. if (is_win) {
  839. sources += [ "win32_socket_init.h" ]
  840. if (current_os != "winuwp") {
  841. sources += [
  842. "win32_socket_server.cc",
  843. "win32_socket_server.h",
  844. ]
  845. }
  846. }
  847. } # !build_with_chromium
  848. if (rtc_build_ssl) {
  849. deps += [ "//third_party/boringssl" ]
  850. } else {
  851. configs += [ ":external_ssl_library" ]
  852. }
  853. if (is_android) {
  854. sources += [
  855. "ifaddrs_android.cc",
  856. "ifaddrs_android.h",
  857. ]
  858. libs += [
  859. "log",
  860. "GLESv2",
  861. ]
  862. }
  863. if (is_ios || is_mac) {
  864. sources += [ "mac_ifaddrs_converter.cc" ]
  865. deps += [ "system:cocoa_threading" ]
  866. }
  867. if (is_linux) {
  868. libs += [
  869. "dl",
  870. "rt",
  871. ]
  872. }
  873. if (is_ios) {
  874. libs += [
  875. "CFNetwork.framework",
  876. "Foundation.framework",
  877. "Security.framework",
  878. "SystemConfiguration.framework",
  879. "UIKit.framework",
  880. ]
  881. }
  882. if (is_win) {
  883. sources += [
  884. "win32.cc",
  885. "win32.h",
  886. "win32_window.cc",
  887. "win32_window.h",
  888. ]
  889. libs += [
  890. "crypt32.lib",
  891. "iphlpapi.lib",
  892. "secur32.lib",
  893. ]
  894. defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ]
  895. }
  896. if (is_posix || is_fuchsia) {
  897. sources += [
  898. "ifaddrs_converter.cc",
  899. "ifaddrs_converter.h",
  900. ]
  901. }
  902. if (is_nacl) {
  903. public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] # no-presubmit-check TODO(webrtc:8603)
  904. defines += [ "timezone=_timezone" ]
  905. sources -= [ "ifaddrs_converter.cc" ]
  906. }
  907. }
  908. rtc_source_set("gtest_prod") {
  909. sources = [
  910. "gtest_prod_util.h",
  911. ]
  912. }
  913. rtc_library("gunit_helpers") {
  914. testonly = true
  915. sources = [
  916. "gunit.cc",
  917. "gunit.h",
  918. ]
  919. deps = [
  920. ":logging",
  921. ":rtc_base",
  922. ":rtc_base_tests_utils",
  923. ":stringutils",
  924. "../test:test_support",
  925. "//third_party/abseil-cpp/absl/strings",
  926. ]
  927. }
  928. rtc_library("testclient") {
  929. testonly = true
  930. sources = [
  931. "test_client.cc",
  932. "test_client.h",
  933. ]
  934. deps = [
  935. ":criticalsection",
  936. ":gunit_helpers",
  937. ":macromagic",
  938. ":rtc_base",
  939. ":rtc_base_tests_utils",
  940. ":timeutils",
  941. ]
  942. }
  943. rtc_library("rtc_base_tests_utils") {
  944. testonly = true
  945. sources = [
  946. "cpu_time.cc",
  947. "cpu_time.h",
  948. "fake_clock.cc",
  949. "fake_clock.h",
  950. "fake_mdns_responder.h",
  951. "fake_network.h",
  952. "fake_ssl_identity.cc",
  953. "fake_ssl_identity.h",
  954. "firewall_socket_server.cc",
  955. "firewall_socket_server.h",
  956. "memory_stream.cc",
  957. "memory_stream.h",
  958. "memory_usage.cc",
  959. "memory_usage.h",
  960. "nat_server.cc",
  961. "nat_server.h",
  962. "nat_socket_factory.cc",
  963. "nat_socket_factory.h",
  964. "nat_types.cc",
  965. "nat_types.h",
  966. "proxy_server.cc",
  967. "proxy_server.h",
  968. "server_socket_adapters.cc",
  969. "server_socket_adapters.h",
  970. "sigslot_tester.h",
  971. "socket_stream.cc",
  972. "socket_stream.h",
  973. "test_base64.h",
  974. "test_certificate_verifier.h",
  975. "test_echo_server.cc",
  976. "test_echo_server.h",
  977. "test_utils.cc",
  978. "test_utils.h",
  979. "virtual_socket_server.cc",
  980. "virtual_socket_server.h",
  981. ]
  982. deps = [
  983. ":checks",
  984. ":rtc_base",
  985. "../api/units:time_delta",
  986. "../api/units:timestamp",
  987. "memory:fifo_buffer",
  988. "third_party/sigslot",
  989. "//third_party/abseil-cpp/absl/algorithm:container",
  990. "//third_party/abseil-cpp/absl/memory",
  991. ]
  992. }
  993. rtc_library("task_queue_for_test") {
  994. testonly = true
  995. sources = [
  996. "task_queue_for_test.cc",
  997. "task_queue_for_test.h",
  998. ]
  999. deps = [
  1000. ":checks",
  1001. ":macromagic",
  1002. ":rtc_base_approved",
  1003. ":rtc_event",
  1004. ":rtc_task_queue",
  1005. "../api/task_queue",
  1006. "../api/task_queue:default_task_queue_factory",
  1007. "task_utils:to_queued_task",
  1008. "//third_party/abseil-cpp/absl/strings",
  1009. ]
  1010. }
  1011. if (rtc_include_tests) {
  1012. rtc_library("sigslot_unittest") {
  1013. testonly = true
  1014. sources = [
  1015. "sigslot_unittest.cc",
  1016. ]
  1017. deps = [
  1018. ":gunit_helpers",
  1019. ":rtc_base",
  1020. ":rtc_base_tests_utils",
  1021. "../test:test_support",
  1022. "third_party/sigslot",
  1023. ]
  1024. }
  1025. rtc_library("rtc_base_nonparallel_tests") {
  1026. testonly = true
  1027. sources = [
  1028. "cpu_time_unittest.cc",
  1029. "file_rotating_stream_unittest.cc",
  1030. "null_socket_server_unittest.cc",
  1031. "physical_socket_server_unittest.cc",
  1032. "socket_address_unittest.cc",
  1033. "socket_unittest.cc",
  1034. "socket_unittest.h",
  1035. ]
  1036. deps = [
  1037. ":checks",
  1038. ":gunit_helpers",
  1039. ":rtc_base",
  1040. ":rtc_base_tests_utils",
  1041. ":testclient",
  1042. "../system_wrappers",
  1043. "../test:fileutils",
  1044. "../test:test_main",
  1045. "../test:test_support",
  1046. "third_party/sigslot",
  1047. "//testing/gtest",
  1048. "//third_party/abseil-cpp/absl/memory",
  1049. ]
  1050. if (is_win) {
  1051. sources += [ "win32_socket_server_unittest.cc" ]
  1052. }
  1053. }
  1054. rtc_library("rtc_base_approved_unittests") {
  1055. testonly = true
  1056. sources = [
  1057. "atomic_ops_unittest.cc",
  1058. "base64_unittest.cc",
  1059. "bind_unittest.cc",
  1060. "bit_buffer_unittest.cc",
  1061. "buffer_queue_unittest.cc",
  1062. "buffer_unittest.cc",
  1063. "byte_buffer_unittest.cc",
  1064. "byte_order_unittest.cc",
  1065. "copy_on_write_buffer_unittest.cc",
  1066. "critical_section_unittest.cc",
  1067. "event_tracer_unittest.cc",
  1068. "event_unittest.cc",
  1069. "logging_unittest.cc",
  1070. "numerics/divide_round_unittest.cc",
  1071. "numerics/histogram_percentile_counter_unittest.cc",
  1072. "numerics/mod_ops_unittest.cc",
  1073. "numerics/moving_max_counter_unittest.cc",
  1074. "numerics/safe_compare_unittest.cc",
  1075. "numerics/safe_minmax_unittest.cc",
  1076. "numerics/sample_counter_unittest.cc",
  1077. "one_time_event_unittest.cc",
  1078. "platform_thread_unittest.cc",
  1079. "random_unittest.cc",
  1080. "rate_limiter_unittest.cc",
  1081. "rate_statistics_unittest.cc",
  1082. "rate_tracker_unittest.cc",
  1083. "ref_counted_object_unittest.cc",
  1084. "sanitizer_unittest.cc",
  1085. "string_encode_unittest.cc",
  1086. "string_to_number_unittest.cc",
  1087. "string_utils_unittest.cc",
  1088. "stringize_macros_unittest.cc",
  1089. "strings/string_builder_unittest.cc",
  1090. "swap_queue_unittest.cc",
  1091. "thread_annotations_unittest.cc",
  1092. "thread_checker_unittest.cc",
  1093. "time_utils_unittest.cc",
  1094. "timestamp_aligner_unittest.cc",
  1095. "virtual_socket_unittest.cc",
  1096. "zero_memory_unittest.cc",
  1097. ]
  1098. if (is_win) {
  1099. sources += [ "win/windows_version_unittest.cc" ]
  1100. }
  1101. deps = [
  1102. ":checks",
  1103. ":divide_round",
  1104. ":gunit_helpers",
  1105. ":rate_limiter",
  1106. ":rtc_base",
  1107. ":rtc_base_approved",
  1108. ":rtc_base_tests_utils",
  1109. ":rtc_task_queue",
  1110. ":safe_compare",
  1111. ":safe_minmax",
  1112. ":sanitizer",
  1113. ":stringutils",
  1114. ":testclient",
  1115. "../api:array_view",
  1116. "../api:scoped_refptr",
  1117. "../api/units:time_delta",
  1118. "../system_wrappers",
  1119. "../test:fileutils",
  1120. "../test:test_main",
  1121. "../test:test_support",
  1122. "memory:unittests",
  1123. "third_party/base64",
  1124. "third_party/sigslot",
  1125. "//third_party/abseil-cpp/absl/base:core_headers",
  1126. "//third_party/abseil-cpp/absl/memory",
  1127. ]
  1128. }
  1129. rtc_library("rtc_task_queue_unittests") {
  1130. testonly = true
  1131. sources = [
  1132. "task_queue_unittest.cc",
  1133. ]
  1134. deps = [
  1135. ":gunit_helpers",
  1136. ":rtc_base_approved",
  1137. ":rtc_base_tests_utils",
  1138. ":rtc_task_queue",
  1139. ":task_queue_for_test",
  1140. "../test:test_main",
  1141. "../test:test_support",
  1142. "//third_party/abseil-cpp/absl/memory",
  1143. ]
  1144. }
  1145. rtc_library("weak_ptr_unittests") {
  1146. testonly = true
  1147. sources = [
  1148. "weak_ptr_unittest.cc",
  1149. ]
  1150. deps = [
  1151. ":gunit_helpers",
  1152. ":rtc_base_approved",
  1153. ":rtc_base_tests_utils",
  1154. ":rtc_event",
  1155. ":task_queue_for_test",
  1156. ":weak_ptr",
  1157. "../test:test_main",
  1158. "../test:test_support",
  1159. ]
  1160. }
  1161. rtc_library("rtc_numerics_unittests") {
  1162. testonly = true
  1163. sources = [
  1164. "numerics/exp_filter_unittest.cc",
  1165. "numerics/moving_average_unittest.cc",
  1166. "numerics/moving_median_filter_unittest.cc",
  1167. "numerics/percentile_filter_unittest.cc",
  1168. "numerics/running_statistics_unittest.cc",
  1169. "numerics/samples_stats_counter_unittest.cc",
  1170. "numerics/sequence_number_util_unittest.cc",
  1171. ]
  1172. deps = [
  1173. ":rtc_base_approved",
  1174. ":rtc_numerics",
  1175. "../test:test_main",
  1176. "../test:test_support",
  1177. "//third_party/abseil-cpp/absl/algorithm:container",
  1178. ]
  1179. }
  1180. rtc_library("rtc_json_unittests") {
  1181. testonly = true
  1182. sources = [
  1183. "strings/json_unittest.cc",
  1184. ]
  1185. deps = [
  1186. ":gunit_helpers",
  1187. ":rtc_base_tests_utils",
  1188. ":rtc_json",
  1189. "../test:test_main",
  1190. "../test:test_support",
  1191. ]
  1192. }
  1193. rtc_library("rtc_base_unittests") {
  1194. testonly = true
  1195. defines = []
  1196. sources = [
  1197. "callback_unittest.cc",
  1198. "crc32_unittest.cc",
  1199. "data_rate_limiter_unittest.cc",
  1200. "fake_clock_unittest.cc",
  1201. "helpers_unittest.cc",
  1202. "ip_address_unittest.cc",
  1203. "memory_usage_unittest.cc",
  1204. "message_digest_unittest.cc",
  1205. "message_queue_unittest.cc",
  1206. "nat_unittest.cc",
  1207. "network_unittest.cc",
  1208. "proxy_unittest.cc",
  1209. "rolling_accumulator_unittest.cc",
  1210. "rtc_certificate_generator_unittest.cc",
  1211. "rtc_certificate_unittest.cc",
  1212. "signal_thread_unittest.cc",
  1213. "sigslot_tester_unittest.cc",
  1214. "test_client_unittest.cc",
  1215. "thread_unittest.cc",
  1216. "unique_id_generator_unittest.cc",
  1217. ]
  1218. if (is_win) {
  1219. sources += [
  1220. "win32_unittest.cc",
  1221. "win32_window_unittest.cc",
  1222. ]
  1223. }
  1224. if (is_posix || is_fuchsia) {
  1225. sources += [
  1226. "openssl_adapter_unittest.cc",
  1227. "openssl_session_cache_unittest.cc",
  1228. "openssl_utility_unittest.cc",
  1229. "ssl_adapter_unittest.cc",
  1230. "ssl_identity_unittest.cc",
  1231. "ssl_stream_adapter_unittest.cc",
  1232. ]
  1233. }
  1234. deps = [
  1235. ":checks",
  1236. ":gunit_helpers",
  1237. ":rtc_base_tests_utils",
  1238. ":stringutils",
  1239. ":testclient",
  1240. "../api:array_view",
  1241. "../test:fileutils",
  1242. "../test:test_main",
  1243. "../test:test_support",
  1244. "memory:fifo_buffer",
  1245. "synchronization:synchronization_unittests",
  1246. "third_party/sigslot",
  1247. "//third_party/abseil-cpp/absl/algorithm:container",
  1248. "//third_party/abseil-cpp/absl/memory",
  1249. "//third_party/abseil-cpp/absl/strings",
  1250. "//third_party/abseil-cpp/absl/types:optional",
  1251. ]
  1252. public_deps = [
  1253. ":rtc_base",
  1254. ]
  1255. if (build_with_chromium) {
  1256. include_dirs = [ "../../boringssl/src/include" ]
  1257. }
  1258. if (rtc_build_ssl) {
  1259. deps += [ "//third_party/boringssl" ]
  1260. } else {
  1261. configs += [ ":external_ssl_library" ]
  1262. }
  1263. }
  1264. }
  1265. if (is_android) {
  1266. rtc_android_library("base_java") {
  1267. visibility = [ "*" ]
  1268. java_files = [
  1269. "java/src/org/webrtc/ContextUtils.java",
  1270. "java/src/org/webrtc/Loggable.java",
  1271. "java/src/org/webrtc/Logging.java",
  1272. "java/src/org/webrtc/Size.java",
  1273. "java/src/org/webrtc/ThreadUtils.java",
  1274. ]
  1275. deps = [
  1276. "//third_party/android_deps:com_android_support_support_annotations_java",
  1277. ]
  1278. }
  1279. }