blob: 4c9f591ec1d1ab8d55cf3fd3972647be56086252 [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",
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +010024 "//third_party/abseil-cpp/absl/base:config",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010025 "//third_party/abseil-cpp/absl/base:core_headers",
26 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov959e9b62019-01-14 14:29:18 +010027 ]
28}
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010029
Mirko Bonadei86d053c2019-10-17 21:32:04 +020030rtc_library("task_queue_test") {
Danil Chapovalov33b716f2019-01-22 18:15:37 +010031 visibility = [ "*" ]
32 testonly = true
33 sources = [
34 "task_queue_test.cc",
35 "task_queue_test.h",
36 ]
Mirko Bonadeic04792e2019-10-22 14:57:03 -070037
38 check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
39 if (build_with_chromium) {
Mirko Bonadei92dd35d2019-11-15 16:08:41 +010040 visibility = []
41 visibility = webrtc_default_visibility
42 visibility += [
43 # This is the only Chromium target that can depend on this. The reason
44 # behind this is the fact that this is a 'testonly' target and as such
45 # it cannot be part of the WebRTC component.
46 "//third_party/blink/renderer/platform:blink_platform_unittests_sources",
47 ]
48
Mirko Bonadeic04792e2019-10-22 14:57:03 -070049 # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
50 # because this will break the WebRTC component build in Chromium.
51 deps = [
52 "../../../webrtc_overrides:webrtc_component",
53 "../../test:test_support",
54 "//third_party/abseil-cpp/absl/memory",
55 "//third_party/abseil-cpp/absl/strings",
56 ]
57 } else {
58 deps = [
59 ":task_queue",
60 "../../rtc_base:refcount",
61 "../../rtc_base:rtc_event",
62 "../../rtc_base:timeutils",
63 "../../rtc_base/task_utils:to_queued_task",
64 "../../test:test_support",
65 "//third_party/abseil-cpp/absl/memory",
66 "//third_party/abseil-cpp/absl/strings",
67 ]
68 }
Danil Chapovalov33b716f2019-01-22 18:15:37 +010069}
70
Mirko Bonadei86d053c2019-10-17 21:32:04 +020071rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010072 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +020073 if (!is_ios && !is_android) {
74 poisonous = [ "default_task_queue" ]
75 }
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010076 sources = [ "default_task_queue_factory.h" ]
77 deps = [ ":task_queue" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010078
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000079 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010080 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000081 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
82 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010083 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000084 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
85 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010086 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000087 deps += [ "../../rtc_base:rtc_task_queue_win" ]
88 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010089 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000090 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010091 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010092}
93
Danil Chapovalov2684ab32019-02-26 10:18:08 +010094if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020095 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010096 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010097 sources = [ "default_task_queue_factory_unittest.cc" ]
Danil Chapovalov2684ab32019-02-26 10:18:08 +010098 deps = [
99 ":default_task_queue_factory",
100 ":task_queue_test",
101 "../../test:test_support",
102 ]
103 }
104}