blob: 7d449778bbc6b0d4c3a5553411640098816cfe2d [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",
Mirko Bonadeid4002a72019-11-12 20:11:48 +010025 "../../rtc_base/system:rtc_export",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +010026 "//third_party/abseil-cpp/absl/base:config",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010027 "//third_party/abseil-cpp/absl/base:core_headers",
28 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov959e9b62019-01-14 14:29:18 +010029 ]
30}
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010031
Mirko Bonadei86d053c2019-10-17 21:32:04 +020032rtc_library("task_queue_test") {
Danil Chapovalov33b716f2019-01-22 18:15:37 +010033 visibility = [ "*" ]
34 testonly = true
35 sources = [
36 "task_queue_test.cc",
37 "task_queue_test.h",
38 ]
Mirko Bonadeic04792e2019-10-22 14:57:03 -070039
40 check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
41 if (build_with_chromium) {
42 # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
43 # because this will break the WebRTC component build in Chromium.
44 deps = [
45 "../../../webrtc_overrides:webrtc_component",
46 "../../test:test_support",
47 "//third_party/abseil-cpp/absl/memory",
48 "//third_party/abseil-cpp/absl/strings",
49 ]
50 } else {
51 deps = [
52 ":task_queue",
53 "../../rtc_base:refcount",
54 "../../rtc_base:rtc_event",
55 "../../rtc_base:timeutils",
56 "../../rtc_base/task_utils:to_queued_task",
57 "../../test:test_support",
58 "//third_party/abseil-cpp/absl/memory",
59 "//third_party/abseil-cpp/absl/strings",
60 ]
61 }
Danil Chapovalov33b716f2019-01-22 18:15:37 +010062}
63
Mirko Bonadei86d053c2019-10-17 21:32:04 +020064rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010065 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +020066 if (!is_ios && !is_android) {
67 poisonous = [ "default_task_queue" ]
68 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010069 sources = [
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010070 "default_task_queue_factory.h",
71 ]
72 deps = [
Danil Chapovalovd00405f2019-02-25 15:06:13 +010073 ":task_queue",
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010074 ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010075
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000076 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010077 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000078 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
79 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010080 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000081 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
82 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010083 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000084 deps += [ "../../rtc_base:rtc_task_queue_win" ]
85 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010086 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000087 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010088 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010089}
90
Danil Chapovalov2684ab32019-02-26 10:18:08 +010091if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020092 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010093 testonly = true
94 sources = [
95 "default_task_queue_factory_unittest.cc",
96 ]
97 deps = [
98 ":default_task_queue_factory",
99 ":task_queue_test",
100 "../../test:test_support",
101 ]
102 }
103}