blob: ebb7e39deccc77c69330e3ff592d91e1a39b4331 [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
11rtc_source_set("task_queue") {
12 visibility = [ "*" ]
13 public = [
14 "queued_task.h",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010015 "task_queue_priority.h",
16 ]
17}
18
19# TODO(bugs.webrtc.org/10191): Merge the target into task_queue target above
20# when support for link-time injection is dropped.
21rtc_source_set("task_queue_factory") {
22 visibility = [ "*" ]
23 public = [
24 "task_queue_base.h",
25 "task_queue_factory.h",
26 ]
27 sources = [
28 "task_queue_base.cc",
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +010029 "task_queue_impl.cc",
30 "task_queue_impl.h",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010031 ]
32
33 deps = [
34 ":task_queue",
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +010035 "../../rtc_base:checks",
36 "../../rtc_base:rtc_task_queue_api",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010037 "//third_party/abseil-cpp/absl/base:core_headers",
38 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov959e9b62019-01-14 14:29:18 +010039 ]
40}
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010041
Danil Chapovalov33b716f2019-01-22 18:15:37 +010042rtc_source_set("task_queue_test") {
43 visibility = [ "*" ]
44 testonly = true
45 sources = [
46 "task_queue_test.cc",
47 "task_queue_test.h",
48 ]
49 deps = [
50 ":task_queue",
51 ":task_queue_factory",
52 "../../rtc_base:rtc_event",
53 "../../rtc_base:rtc_task_queue_api",
54 "../../rtc_base:timeutils",
55 "../../test:test_support",
56 "//third_party/abseil-cpp/absl/memory",
57 "//third_party/abseil-cpp/absl/strings",
58 ]
59}
60
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010061rtc_source_set("default_task_queue_factory") {
62 # TODO(bugs.webrtc.org/10191): Make public when implemented for all
63 # supported platforms.
64 visibility = [ ":global_task_queue_factory" ]
65 sources = [
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010066 "default_task_queue_factory.h",
67 ]
68 deps = [
69 ":task_queue_factory",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010070 ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010071
72 # TODO(bugs.webrtc.org/10284): Include implementation unconditionally when
73 # global task queue factory is removed.
74 if (rtc_link_task_queue_impl) {
Danil Chapovaloveb175242019-02-12 10:44:38 +010075 deps += [ ":default_task_queue_factory_impl" ]
76 }
77}
78
79# TODO(bugs.webrtc.org/10191): Merge back to default_task_queue_factory when
80# rtc_task_queue_impl build target is removed.
81rtc_source_set("default_task_queue_factory_impl") {
82 # Include the implementation when rtc_link_task_queue_impl is set to default
83 # value of true or when explicit dependency on "rtc_task_queue_impl" is added.
84 visibility = [
85 ":default_task_queue_factory",
86 "../../rtc_base:rtc_task_queue_impl",
87 ]
88 deps = [
89 ":task_queue_factory",
90 ]
91 if (rtc_enable_libevent) {
92 sources = [
93 "default_task_queue_factory_libevent.cc",
94 ]
95 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
96 } else {
97 sources = [
98 "default_task_queue_factory_unimplemented.cc",
99 ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +0100100 deps += [ "../../rtc_base:checks" ]
101 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +0100102}
103
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +0100104# Linking with global_task_queue_factory adds link-time implementation of the
105# rtc::TaskQueue that allows run-time injection of the TaskQueue implementaion.
Danil Chapovalovbaaf9112019-01-18 10:09:40 +0100106rtc_source_set("global_task_queue_factory") {
Danil Chapovalov87ce8742019-02-01 19:40:11 +0100107 # TODO(bugs.webrtc.org/10284): Remove this target when task queue factory
108 # propagated to all components that create TaskQueues.
Danil Chapovalovbaaf9112019-01-18 10:09:40 +0100109 visibility = [ "*" ]
110 sources = [
111 "global_task_queue_factory.cc",
112 "global_task_queue_factory.h",
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +0100113
114 # TODO(bugs.webrtc.org/10191): Move task_queue.cc to private build
115 # "rtc_task_queue" when "rtc_task_queue_api", "rtc_task_queue",
116 # and "rtc_task_queue_impl" can be joined.
117 "task_queue.cc",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +0100118 ]
119 deps = [
120 ":default_task_queue_factory",
121 ":task_queue_factory",
122 "../../rtc_base:checks",
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +0100123 "../../rtc_base:rtc_task_queue_api",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +0100124 ]
125}