blob: 19b9e0ed2d60c41923ca69d3f7fd88b563529fda [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_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
Danil Chapovalov33b716f2019-01-22 18:15:37 +010031rtc_source_set("task_queue_test") {
32 visibility = [ "*" ]
33 testonly = true
34 sources = [
35 "task_queue_test.cc",
36 "task_queue_test.h",
37 ]
38 deps = [
39 ":task_queue",
Danil Chapovalovf504dd32019-06-05 14:16:59 +020040 "../../rtc_base:refcount",
Danil Chapovalov33b716f2019-01-22 18:15:37 +010041 "../../rtc_base:rtc_event",
Danil Chapovalov33b716f2019-01-22 18:15:37 +010042 "../../rtc_base:timeutils",
Danil Chapovalov3b548dd2019-03-01 14:58:44 +010043 "../../rtc_base/task_utils:to_queued_task",
Danil Chapovalov33b716f2019-01-22 18:15:37 +010044 "../../test:test_support",
45 "//third_party/abseil-cpp/absl/memory",
46 "//third_party/abseil-cpp/absl/strings",
47 ]
48}
49
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010050rtc_source_set("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010051 visibility = [ "*" ]
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010052 sources = [
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010053 "default_task_queue_factory.h",
54 ]
55 deps = [
Danil Chapovalovd00405f2019-02-25 15:06:13 +010056 ":task_queue",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010057 ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010058
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000059 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010060 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000061 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
62 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010063 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000064 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
65 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010066 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000067 deps += [ "../../rtc_base:rtc_task_queue_win" ]
68 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010069 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000070 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010071 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010072}
73
Danil Chapovalov2684ab32019-02-26 10:18:08 +010074if (rtc_include_tests) {
75 rtc_source_set("task_queue_default_factory_unittests") {
76 testonly = true
77 sources = [
78 "default_task_queue_factory_unittest.cc",
79 ]
80 deps = [
81 ":default_task_queue_factory",
82 ":task_queue_test",
83 "../../test:test_support",
84 ]
85 }
86}