kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 1 | # Copyright (c) 2014 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 | |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 9 | if (is_android) { |
| 10 | import("//build/config/android/config.gni") |
| 11 | import("//build/config/android/rules.gni") |
| 12 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 13 | import("../webrtc.gni") |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 14 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 15 | rtc_library("system_wrappers") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 16 | visibility = [ "*" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 17 | sources = [ |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 18 | "include/clock.h", |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 19 | "include/cpu_info.h", |
kjellander | 080a1e3 | 2016-05-25 11:37:11 -0700 | [diff] [blame] | 20 | "include/ntp_time.h", |
asapersson | fe50b4d | 2016-12-22 07:53:51 -0800 | [diff] [blame] | 21 | "include/rtp_to_ntp_estimator.h", |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 22 | "include/sleep.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 23 | "source/clock.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 24 | "source/cpu_features.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 25 | "source/cpu_info.cc", |
asapersson | fe50b4d | 2016-12-22 07:53:51 -0800 | [diff] [blame] | 26 | "source/rtp_to_ntp_estimator.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 27 | "source/sleep.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 28 | ] |
| 29 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 30 | defines = [] |
| 31 | libs = [] |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 32 | deps = [ |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 33 | ":cpu_features_api", |
Ilya Nikolaevskiy | f1cc3a2 | 2018-11-12 15:03:51 +0100 | [diff] [blame] | 34 | "../api:array_view", |
Sebastian Jansson | 4de3115 | 2019-06-11 08:52:11 +0200 | [diff] [blame] | 35 | "../api/units:timestamp", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 36 | "../modules:module_api_public", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 37 | "../rtc_base:checks", |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 38 | "../rtc_base/synchronization:rw_lock_wrapper", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 39 | "../rtc_base/system:arch", |
Johannes Kron | 6d2dfeb | 2020-03-09 12:58:47 +0100 | [diff] [blame] | 40 | "../rtc_base/system:rtc_export", |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 41 | ] |
Mirko Bonadei | 2dcf348 | 2020-06-05 14:30:41 +0200 | [diff] [blame] | 42 | absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 43 | |
| 44 | if (is_android) { |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 45 | if (build_with_mozilla) { |
| 46 | include_dirs = [ |
| 47 | "/config/external/nspr", |
| 48 | "/nsprpub/lib/ds", |
| 49 | "/nsprpub/pr/include", |
| 50 | ] |
| 51 | } else { |
| 52 | deps += [ ":cpu_features_android" ] |
| 53 | } |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 54 | |
| 55 | libs += [ "log" ] |
| 56 | } |
| 57 | |
| 58 | if (is_linux) { |
simon.hosie | 953b1c1 | 2016-04-06 14:02:26 -0700 | [diff] [blame] | 59 | if (!build_with_chromium) { |
| 60 | deps += [ ":cpu_features_linux" ] |
| 61 | } |
| 62 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 63 | libs += [ "rt" ] |
| 64 | } |
| 65 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 66 | if (is_win) { |
| 67 | libs += [ "winmm.lib" ] |
| 68 | |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 69 | # Windows needs ../rtc_base due to include of |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 70 | # webrtc/rtc_base/win32.h in source/clock.cc. |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 71 | deps += [ "../rtc_base" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Ilya Nikolaevskiy | 8b64fd8 | 2017-11-15 16:48:04 +0000 | [diff] [blame] | 74 | deps += [ |
| 75 | "../rtc_base:rtc_base_approved", |
| 76 | "../rtc_base:rtc_numerics", |
| 77 | ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 78 | } |
| 79 | |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 80 | rtc_source_set("cpu_features_api") { |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 81 | sources = [ "include/cpu_features_wrapper.h" ] |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 84 | rtc_library("field_trial") { |
Mirko Bonadei | 92e0038 | 2018-09-15 10:37:11 +0200 | [diff] [blame] | 85 | visibility = [ "*" ] |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 86 | public = [ "include/field_trial.h" ] |
| 87 | sources = [ "source/field_trial.cc" ] |
Mirko Bonadei | 92e0038 | 2018-09-15 10:37:11 +0200 | [diff] [blame] | 88 | if (rtc_exclude_field_trial_default) { |
| 89 | defines = [ "WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT" ] |
| 90 | } |
Jonas Olsson | 5b2eda4 | 2019-06-11 14:29:40 +0200 | [diff] [blame] | 91 | deps = [ |
| 92 | "../rtc_base:checks", |
| 93 | "../rtc_base:logging", |
Konrad Hofbauer | ee1e015 | 2019-12-05 16:25:40 +0100 | [diff] [blame] | 94 | "../rtc_base:stringutils", |
Jonas Olsson | 5b2eda4 | 2019-06-11 14:29:40 +0200 | [diff] [blame] | 95 | ] |
Mirko Bonadei | 2dcf348 | 2020-06-05 14:30:41 +0200 | [diff] [blame] | 96 | absl_deps = [ "//third_party/abseil-cpp/absl/strings" ] |
Mirko Bonadei | 92e0038 | 2018-09-15 10:37:11 +0200 | [diff] [blame] | 97 | } |
| 98 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 99 | rtc_library("metrics") { |
Mirko Bonadei | c1c2a88 | 2018-09-06 13:34:51 +0200 | [diff] [blame] | 100 | visibility = [ "*" ] |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 101 | public = [ "include/metrics.h" ] |
| 102 | sources = [ "source/metrics.cc" ] |
Mirko Bonadei | c1c2a88 | 2018-09-06 13:34:51 +0200 | [diff] [blame] | 103 | if (rtc_exclude_metrics_default) { |
| 104 | defines = [ "WEBRTC_EXCLUDE_METRICS_DEFAULT" ] |
| 105 | } |
| 106 | deps = [ |
Mirko Bonadei | c1c2a88 | 2018-09-06 13:34:51 +0200 | [diff] [blame] | 107 | "../rtc_base:checks", |
| 108 | "../rtc_base:rtc_base_approved", |
| 109 | ] |
| 110 | } |
| 111 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 112 | if (is_android && !build_with_mozilla) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 113 | rtc_library("cpu_features_android") { |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 114 | sources = [ "source/cpu_features_android.c" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 115 | |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 116 | deps = [ "//third_party/android_sdk:cpu_features" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 117 | } |
| 118 | } |
simon.hosie | 953b1c1 | 2016-04-06 14:02:26 -0700 | [diff] [blame] | 119 | |
| 120 | if (is_linux) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 121 | rtc_library("cpu_features_linux") { |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 122 | sources = [ "source/cpu_features_linux.c" ] |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 123 | deps = [ |
| 124 | ":cpu_features_api", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 125 | "../rtc_base/system:arch", |
kjellander | 8a11663 | 2017-04-21 05:17:08 -0700 | [diff] [blame] | 126 | ] |
simon.hosie | 953b1c1 | 2016-04-06 14:02:26 -0700 | [diff] [blame] | 127 | } |
| 128 | } |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 129 | |
kjellander@webrtc.org | aff499c | 2016-06-06 23:04:31 +0200 | [diff] [blame] | 130 | if (rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 131 | rtc_test("system_wrappers_unittests") { |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 132 | testonly = true |
| 133 | sources = [ |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 134 | "source/clock_unittest.cc", |
Jonas Olsson | 5b2eda4 | 2019-06-11 14:29:40 +0200 | [diff] [blame] | 135 | "source/field_trial_unittest.cc", |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 136 | "source/metrics_default_unittest.cc", |
| 137 | "source/metrics_unittest.cc", |
| 138 | "source/ntp_time_unittest.cc", |
asapersson | fe50b4d | 2016-12-22 07:53:51 -0800 | [diff] [blame] | 139 | "source/rtp_to_ntp_estimator_unittest.cc", |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 140 | ] |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 141 | |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 142 | deps = [ |
Jonas Olsson | 5b2eda4 | 2019-06-11 14:29:40 +0200 | [diff] [blame] | 143 | ":field_trial", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame] | 144 | ":metrics", |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 145 | ":system_wrappers", |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 146 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 147 | "../rtc_base:rtc_base_approved", |
Artem Titov | 9dc209a | 2019-11-28 17:09:30 +0100 | [diff] [blame] | 148 | "../test:rtc_expect_death", |
ehmaldonado | 26bddb9 | 2016-11-30 06:12:01 -0800 | [diff] [blame] | 149 | "../test:test_main", |
Yves Gerey | 21cddff | 2018-10-30 21:12:42 +0100 | [diff] [blame] | 150 | "../test:test_support", |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 151 | "//testing/gtest", |
Jonas Olsson | 5b2eda4 | 2019-06-11 14:29:40 +0200 | [diff] [blame] | 152 | "//third_party/abseil-cpp/absl/strings", |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 153 | ] |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 154 | |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 155 | if (is_android) { |
| 156 | deps += [ "//testing/android/native_test:native_test_support" ] |
sakal | 714dd4e | 2016-08-15 02:29:11 -0700 | [diff] [blame] | 157 | |
| 158 | shard_timeout = 900 |
kjellander@webrtc.org | dc0dbad | 2016-06-02 13:29:07 +0200 | [diff] [blame] | 159 | } |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 160 | } |
| 161 | } |