blob: 5c1a1dc26ea3004d7a1a001ef4060e16fd831f46 [file] [log] [blame]
Danil Chapovalov959e9b62019-01-14 14:29:18 +01001# Copyright (c) 2018 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
9import("../../webrtc.gni")
10
Mirko Bonadei86d053c2019-10-17 21:32:04 +020011rtc_library("task_queue") {
Danil Chapovalov959e9b62019-01-14 14:29:18 +010012 visibility = [ "*" ]
13 public = [
14 "queued_task.h",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010015 "task_queue_base.h",
16 "task_queue_factory.h",
17 ]
18 sources = [
19 "task_queue_base.cc",
20 ]
21
22 deps = [
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +010023 "../../rtc_base:checks",
Danil Chapovalov4423c362019-03-06 18:41:39 +010024 "../../rtc_base:macromagic",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +010025 "//third_party/abseil-cpp/absl/base:config",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010026 "//third_party/abseil-cpp/absl/base:core_headers",
27 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov959e9b62019-01-14 14:29:18 +010028 ]
29}
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010030
Mirko Bonadei86d053c2019-10-17 21:32:04 +020031rtc_library("task_queue_test") {
Danil Chapovalov33b716f2019-01-22 18:15:37 +010032 visibility = [ "*" ]
33 testonly = true
34 sources = [
35 "task_queue_test.cc",
36 "task_queue_test.h",
37 ]
Mirko Bonadeic04792e2019-10-22 14:57:03 -070038
39 check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
40 if (build_with_chromium) {
41 # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
42 # because this will break the WebRTC component build in Chromium.
43 deps = [
44 "../../../webrtc_overrides:webrtc_component",
45 "../../test:test_support",
46 "//third_party/abseil-cpp/absl/memory",
47 "//third_party/abseil-cpp/absl/strings",
48 ]
49 } else {
50 deps = [
51 ":task_queue",
52 "../../rtc_base:refcount",
53 "../../rtc_base:rtc_event",
54 "../../rtc_base:timeutils",
55 "../../rtc_base/task_utils:to_queued_task",
56 "../../test:test_support",
57 "//third_party/abseil-cpp/absl/memory",
58 "//third_party/abseil-cpp/absl/strings",
59 ]
60 }
Danil Chapovalov33b716f2019-01-22 18:15:37 +010061}
62
Mirko Bonadei86d053c2019-10-17 21:32:04 +020063rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010064 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +020065 if (!is_ios && !is_android) {
66 poisonous = [ "default_task_queue" ]
67 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010068 sources = [
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010069 "default_task_queue_factory.h",
70 ]
71 deps = [
Danil Chapovalovd00405f2019-02-25 15:06:13 +010072 ":task_queue",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010073 ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010074
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000075 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010076 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000077 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
78 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010079 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000080 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
81 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010082 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000083 deps += [ "../../rtc_base:rtc_task_queue_win" ]
84 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010085 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000086 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010087 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010088}
89
Danil Chapovalov2684ab32019-02-26 10:18:08 +010090if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020091 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010092 testonly = true
93 sources = [
94 "default_task_queue_factory_unittest.cc",
95 ]
96 deps = [
97 ":default_task_queue_factory",
98 ":task_queue_test",
99 "../../test:test_support",
100 ]
101 }
102}