blob: 1072057e3fc82be0e95f46a21c9543b61d315461 [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 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010018 sources = [ "task_queue_base.cc" ]
Danil Chapovalov348b08a2019-01-17 13:07:25 +010019
20 deps = [
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +010021 "../../rtc_base:checks",
Danil Chapovalov4423c362019-03-06 18:41:39 +010022 "../../rtc_base:macromagic",
Mirko Bonadeid4002a72019-11-12 20:11:48 +010023 "../../rtc_base/system:rtc_export",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020024 ]
25 absl_deps = [
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) {
Mirko Bonadei92dd35d2019-11-15 16:08:41 +010042 visibility = []
43 visibility = webrtc_default_visibility
44 visibility += [
45 # This is the only Chromium target that can depend on this. The reason
46 # behind this is the fact that this is a 'testonly' target and as such
47 # it cannot be part of the WebRTC component.
48 "//third_party/blink/renderer/platform:blink_platform_unittests_sources",
49 ]
50
Mirko Bonadeic04792e2019-10-22 14:57:03 -070051 # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
52 # because this will break the WebRTC component build in Chromium.
53 deps = [
54 "../../../webrtc_overrides:webrtc_component",
55 "../../test:test_support",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020056 ]
57 absl_deps = [
Mirko Bonadeic04792e2019-10-22 14:57:03 -070058 "//third_party/abseil-cpp/absl/memory",
59 "//third_party/abseil-cpp/absl/strings",
60 ]
61 } else {
62 deps = [
63 ":task_queue",
64 "../../rtc_base:refcount",
65 "../../rtc_base:rtc_event",
66 "../../rtc_base:timeutils",
67 "../../rtc_base/task_utils:to_queued_task",
68 "../../test:test_support",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020069 ]
70 absl_deps = [
Mirko Bonadeic04792e2019-10-22 14:57:03 -070071 "//third_party/abseil-cpp/absl/memory",
72 "//third_party/abseil-cpp/absl/strings",
73 ]
74 }
Danil Chapovalov33b716f2019-01-22 18:15:37 +010075}
76
Mirko Bonadei86d053c2019-10-17 21:32:04 +020077rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010078 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +020079 if (!is_ios && !is_android) {
80 poisonous = [ "default_task_queue" ]
81 }
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010082 sources = [ "default_task_queue_factory.h" ]
83 deps = [ ":task_queue" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010084
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000085 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010086 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000087 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
88 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010089 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000090 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
91 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010092 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000093 deps += [ "../../rtc_base:rtc_task_queue_win" ]
94 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010095 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000096 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010097 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010098}
99
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100100if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200101 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100102 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100103 sources = [ "default_task_queue_factory_unittest.cc" ]
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100104 deps = [
105 ":default_task_queue_factory",
106 ":task_queue_test",
107 "../../test:test_support",
108 ]
109 }
110}