2014-06-21 14:25:16 +00:00
|
|
|
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# Use of this source code is governed by a BSD-style license
|
|
|
|
|
# that can be found in the LICENSE file in the root of the source
|
|
|
|
|
# tree. An additional intellectual property rights grant can be found
|
|
|
|
|
# in the file PATENTS. All contributing project authors may
|
|
|
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
|
2016-06-02 02:18:48 -07:00
|
|
|
if (is_android) {
|
|
|
|
|
import("//build/config/android/config.gni")
|
|
|
|
|
import("//build/config/android/rules.gni")
|
|
|
|
|
}
|
2017-01-24 06:58:22 -08:00
|
|
|
import("../webrtc.gni")
|
2014-06-21 14:25:16 +00:00
|
|
|
|
2019-10-17 21:32:04 +02:00
|
|
|
rtc_library("system_wrappers") {
|
2018-01-10 15:54:53 +00:00
|
|
|
visibility = [ "*" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
sources = [
|
2015-10-28 18:17:40 +01:00
|
|
|
"include/clock.h",
|
2020-09-05 21:55:35 +02:00
|
|
|
"include/cpu_features_wrapper.h",
|
2015-10-28 18:17:40 +01:00
|
|
|
"include/cpu_info.h",
|
2016-05-25 11:37:11 -07:00
|
|
|
"include/ntp_time.h",
|
2016-12-22 07:53:51 -08:00
|
|
|
"include/rtp_to_ntp_estimator.h",
|
2015-10-28 18:17:40 +01:00
|
|
|
"include/sleep.h",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/clock.cc",
|
|
|
|
|
"source/cpu_features.cc",
|
2015-05-25 12:55:39 +02:00
|
|
|
"source/cpu_info.cc",
|
2016-12-22 07:53:51 -08:00
|
|
|
"source/rtp_to_ntp_estimator.cc",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/sleep.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
|
libs = []
|
2015-05-25 12:55:39 +02:00
|
|
|
deps = [
|
2020-09-25 12:02:32 +02:00
|
|
|
":field_trial",
|
2018-11-12 15:03:51 +01:00
|
|
|
"../api:array_view",
|
2019-06-11 08:52:11 +02:00
|
|
|
"../api/units:timestamp",
|
2017-12-06 09:17:14 +01:00
|
|
|
"../modules:module_api_public",
|
2017-12-13 16:05:42 +01:00
|
|
|
"../rtc_base:checks",
|
2020-07-08 23:04:37 +02:00
|
|
|
"../rtc_base/synchronization:mutex",
|
2018-07-25 16:05:48 +02:00
|
|
|
"../rtc_base/system:arch",
|
2020-03-09 12:58:47 +01:00
|
|
|
"../rtc_base/system:rtc_export",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
2020-06-05 14:30:41 +02:00
|
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
|
|
|
|
|
if (is_android) {
|
2018-01-15 10:20:00 -05:00
|
|
|
if (build_with_mozilla) {
|
|
|
|
|
include_dirs = [
|
|
|
|
|
"/config/external/nspr",
|
|
|
|
|
"/nsprpub/lib/ds",
|
|
|
|
|
"/nsprpub/pr/include",
|
|
|
|
|
]
|
|
|
|
|
} else {
|
2020-09-05 21:55:35 +02:00
|
|
|
sources += [ "source/cpu_features_android.cc" ]
|
|
|
|
|
deps += [ "//third_party/android_sdk:cpu_features" ]
|
2018-01-15 10:20:00 -05:00
|
|
|
}
|
2014-06-21 14:25:16 +00:00
|
|
|
|
|
|
|
|
libs += [ "log" ]
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-10 18:10:11 +09:00
|
|
|
if (is_linux || is_chromeos) {
|
2016-04-06 14:02:26 -07:00
|
|
|
if (!build_with_chromium) {
|
2020-09-05 21:55:35 +02:00
|
|
|
sources += [ "source/cpu_features_linux.cc" ]
|
2016-04-06 14:02:26 -07:00
|
|
|
}
|
|
|
|
|
|
2014-06-21 14:25:16 +00:00
|
|
|
libs += [ "rt" ]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
libs += [ "winmm.lib" ]
|
|
|
|
|
|
2019-03-21 13:35:10 +01:00
|
|
|
# Windows needs ../rtc_base due to include of
|
2017-07-19 10:40:47 -07:00
|
|
|
# webrtc/rtc_base/win32.h in source/clock.cc.
|
2020-09-26 11:57:26 +02:00
|
|
|
deps += [ "../rtc_base:win32" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
2017-11-15 16:48:04 +00:00
|
|
|
deps += [
|
|
|
|
|
"../rtc_base:rtc_base_approved",
|
|
|
|
|
"../rtc_base:rtc_numerics",
|
|
|
|
|
]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-17 21:32:04 +02:00
|
|
|
rtc_library("field_trial") {
|
2018-09-15 10:37:11 +02:00
|
|
|
visibility = [ "*" ]
|
2020-01-21 12:10:10 +01:00
|
|
|
public = [ "include/field_trial.h" ]
|
|
|
|
|
sources = [ "source/field_trial.cc" ]
|
2018-09-15 10:37:11 +02:00
|
|
|
if (rtc_exclude_field_trial_default) {
|
|
|
|
|
defines = [ "WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT" ]
|
|
|
|
|
}
|
2019-06-11 14:29:40 +02:00
|
|
|
deps = [
|
|
|
|
|
"../rtc_base:checks",
|
|
|
|
|
"../rtc_base:logging",
|
2019-12-05 16:25:40 +01:00
|
|
|
"../rtc_base:stringutils",
|
2019-06-11 14:29:40 +02:00
|
|
|
]
|
2020-06-05 14:30:41 +02:00
|
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
|
2017-04-21 05:17:08 -07:00
|
|
|
}
|
|
|
|
|
|
2019-10-17 21:32:04 +02:00
|
|
|
rtc_library("metrics") {
|
2018-01-10 15:54:53 +00:00
|
|
|
visibility = [ "*" ]
|
2020-01-21 12:10:10 +01:00
|
|
|
public = [ "include/metrics.h" ]
|
|
|
|
|
sources = [ "source/metrics.cc" ]
|
2018-09-06 13:34:51 +02:00
|
|
|
if (rtc_exclude_metrics_default) {
|
|
|
|
|
defines = [ "WEBRTC_EXCLUDE_METRICS_DEFAULT" ]
|
|
|
|
|
}
|
2017-04-21 05:17:08 -07:00
|
|
|
deps = [
|
2018-09-06 13:34:51 +02:00
|
|
|
"../rtc_base:checks",
|
2017-07-19 10:40:47 -07:00
|
|
|
"../rtc_base:rtc_base_approved",
|
2020-07-08 23:04:37 +02:00
|
|
|
"../rtc_base/synchronization:mutex",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
2014-10-23 12:57:56 +00:00
|
|
|
}
|
|
|
|
|
|
2021-02-01 09:56:37 +00:00
|
|
|
if (rtc_include_tests && !build_with_chromium) {
|
2016-09-02 04:10:34 -07:00
|
|
|
rtc_test("system_wrappers_unittests") {
|
2016-06-02 13:29:07 +02:00
|
|
|
testonly = true
|
|
|
|
|
sources = [
|
|
|
|
|
"source/clock_unittest.cc",
|
2019-06-11 14:29:40 +02:00
|
|
|
"source/field_trial_unittest.cc",
|
2016-06-02 13:29:07 +02:00
|
|
|
"source/metrics_default_unittest.cc",
|
|
|
|
|
"source/metrics_unittest.cc",
|
|
|
|
|
"source/ntp_time_unittest.cc",
|
2016-12-22 07:53:51 -08:00
|
|
|
"source/rtp_to_ntp_estimator_unittest.cc",
|
2016-06-02 02:18:48 -07:00
|
|
|
]
|
|
|
|
|
|
2016-06-02 13:29:07 +02:00
|
|
|
deps = [
|
2019-06-11 14:29:40 +02:00
|
|
|
":field_trial",
|
2018-09-28 08:51:10 +02:00
|
|
|
":metrics",
|
2016-06-02 13:29:07 +02:00
|
|
|
":system_wrappers",
|
2018-11-28 16:47:49 +01:00
|
|
|
"../rtc_base:checks",
|
2017-07-19 10:40:47 -07:00
|
|
|
"../rtc_base:rtc_base_approved",
|
2019-11-28 17:09:30 +01:00
|
|
|
"../test:rtc_expect_death",
|
2016-11-30 06:12:01 -08:00
|
|
|
"../test:test_main",
|
2018-10-30 21:12:42 +01:00
|
|
|
"../test:test_support",
|
2016-06-02 13:29:07 +02:00
|
|
|
"//testing/gtest",
|
|
|
|
|
]
|
2016-06-02 02:18:48 -07:00
|
|
|
|
2021-01-29 10:50:19 +00:00
|
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
|
|
|
|
|
|
2016-06-02 13:29:07 +02:00
|
|
|
if (is_android) {
|
|
|
|
|
deps += [ "//testing/android/native_test:native_test_support" ]
|
2016-08-15 02:29:11 -07:00
|
|
|
|
|
|
|
|
shard_timeout = 900
|
2016-06-02 13:29:07 +02:00
|
|
|
}
|
2016-06-02 02:18:48 -07:00
|
|
|
}
|
|
|
|
|
}
|