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
|
|
|
|
2016-09-23 00:38:52 -07:00
|
|
|
rtc_static_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",
|
|
|
|
|
"include/cpu_info.h",
|
|
|
|
|
"include/event_wrapper.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",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/event.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 = [
|
2017-04-21 05:17:08 -07:00
|
|
|
":cpu_features_api",
|
|
|
|
|
":field_trial_api",
|
|
|
|
|
":metrics_api",
|
2018-01-15 10:16:54 +01:00
|
|
|
":runtime_enabled_features_api",
|
2017-12-06 09:17:14 +01:00
|
|
|
"..:webrtc_common",
|
|
|
|
|
"../modules:module_api_public",
|
2017-12-13 16:05:42 +01:00
|
|
|
"../rtc_base:checks",
|
2018-03-23 14:53:54 +01:00
|
|
|
"../rtc_base/synchronization:rw_lock_wrapper",
|
2018-07-25 16:05:48 +02:00
|
|
|
"../rtc_base/system:arch",
|
2018-06-21 10:17:24 +02:00
|
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
2014-06-21 14:25:16 +00:00
|
|
|
|
|
|
|
|
if (is_android) {
|
2016-01-26 01:53:20 -08:00
|
|
|
defines += [ "WEBRTC_THREAD_RR" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
|
2018-01-15 10:20:00 -05:00
|
|
|
if (build_with_mozilla) {
|
|
|
|
|
include_dirs = [
|
|
|
|
|
"/config/external/nspr",
|
|
|
|
|
"/nsprpub/lib/ds",
|
|
|
|
|
"/nsprpub/pr/include",
|
|
|
|
|
]
|
|
|
|
|
} else {
|
|
|
|
|
deps += [ ":cpu_features_android" ]
|
|
|
|
|
}
|
2014-06-21 14:25:16 +00:00
|
|
|
|
|
|
|
|
libs += [ "log" ]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_linux) {
|
2016-01-26 01:53:20 -08:00
|
|
|
defines += [ "WEBRTC_THREAD_RR" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
|
2016-04-06 14:02:26 -07:00
|
|
|
if (!build_with_chromium) {
|
|
|
|
|
deps += [ ":cpu_features_linux" ]
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-21 14:25:16 +00:00
|
|
|
libs += [ "rt" ]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_ios || is_mac) {
|
2016-01-26 01:53:20 -08:00
|
|
|
defines += [ "WEBRTC_THREAD_RR" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
|
libs += [ "winmm.lib" ]
|
|
|
|
|
|
2017-08-15 21:48:37 +08:00
|
|
|
# Windows needs ../rtc_base:rtc_base due to include of
|
2017-07-19 10:40:47 -07:00
|
|
|
# webrtc/rtc_base/win32.h in source/clock.cc.
|
|
|
|
|
deps += [ "../rtc_base:rtc_base" ]
|
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
|
|
|
}
|
|
|
|
|
|
2017-04-21 05:17:08 -07:00
|
|
|
rtc_source_set("cpu_features_api") {
|
|
|
|
|
sources = [
|
|
|
|
|
"include/cpu_features_wrapper.h",
|
|
|
|
|
]
|
|
|
|
|
deps = [
|
|
|
|
|
"..:webrtc_common",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc_source_set("field_trial_api") {
|
|
|
|
|
sources = [
|
|
|
|
|
"include/field_trial.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-15 10:16:54 +01:00
|
|
|
rtc_source_set("runtime_enabled_features_api") {
|
2018-01-17 11:53:23 +01:00
|
|
|
visibility = [ "*" ]
|
2018-01-15 10:16:54 +01:00
|
|
|
sources = [
|
|
|
|
|
"include/runtime_enabled_features.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-26 11:43:59 +02:00
|
|
|
rtc_source_set("field_trial_default") {
|
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/field_trial_default.h",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/field_trial_default.cc",
|
|
|
|
|
]
|
2017-04-21 05:17:08 -07:00
|
|
|
deps = [
|
|
|
|
|
":field_trial_api",
|
|
|
|
|
]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
2018-01-15 10:16:54 +01:00
|
|
|
rtc_source_set("runtime_enabled_features_default") {
|
2018-01-17 11:53:23 +01:00
|
|
|
visibility = [ "*" ]
|
2018-09-06 13:45:44 +02:00
|
|
|
configs += [ "..:no_global_constructors" ]
|
2018-01-15 10:16:54 +01:00
|
|
|
sources = [
|
|
|
|
|
"source/runtime_enabled_features_default.cc",
|
|
|
|
|
]
|
|
|
|
|
deps = [
|
|
|
|
|
":runtime_enabled_features_api",
|
|
|
|
|
"../rtc_base:rtc_base_approved",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-06 13:34:51 +02:00
|
|
|
rtc_source_set("metrics") {
|
2018-01-10 15:54:53 +00:00
|
|
|
visibility = [ "*" ]
|
2018-09-06 13:34:51 +02:00
|
|
|
public = [
|
|
|
|
|
"include/metrics.h",
|
2016-05-20 06:29:46 -07:00
|
|
|
"include/metrics_default.h",
|
2014-10-23 12:57:56 +00:00
|
|
|
]
|
2018-09-06 13:34:51 +02:00
|
|
|
sources = [
|
|
|
|
|
"source/metrics.cc",
|
|
|
|
|
]
|
|
|
|
|
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
|
|
|
"..:webrtc_common",
|
|
|
|
|
"../rtc_base:checks",
|
2017-07-19 10:40:47 -07:00
|
|
|
"../rtc_base:rtc_base_approved",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
2014-10-23 12:57:56 +00:00
|
|
|
}
|
|
|
|
|
|
2018-09-06 13:34:51 +02:00
|
|
|
# TODO(bugs.webrtc.org/9631): Remove this as soon as Chromium stops depending
|
|
|
|
|
# on it.
|
|
|
|
|
rtc_source_set("metrics_api") {
|
|
|
|
|
visibility = [ "*" ]
|
|
|
|
|
public_deps = [ # no-presubmit-check TODO(webrtc:8603)
|
|
|
|
|
":metrics",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# TODO(bugs.webrtc.org/9631): Remove this as soon as Chromium stops depending
|
|
|
|
|
# on it.
|
|
|
|
|
rtc_source_set("metrics_default") {
|
|
|
|
|
visibility = [ "*" ]
|
|
|
|
|
public_deps = [ # no-presubmit-check TODO(webrtc:8603)
|
|
|
|
|
":metrics",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-23 00:38:52 -07:00
|
|
|
group("system_wrappers_default") {
|
2014-10-23 12:57:56 +00:00
|
|
|
deps = [
|
|
|
|
|
":field_trial_default",
|
|
|
|
|
":metrics_default",
|
2018-01-15 10:16:54 +01:00
|
|
|
":runtime_enabled_features_default",
|
2015-11-23 14:47:56 -08:00
|
|
|
":system_wrappers",
|
2014-10-23 12:57:56 +00:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-15 10:20:00 -05:00
|
|
|
if (is_android && !build_with_mozilla) {
|
2016-09-23 00:38:52 -07:00
|
|
|
rtc_static_library("cpu_features_android") {
|
2014-06-21 14:25:16 +00:00
|
|
|
sources = [
|
|
|
|
|
"source/cpu_features_android.c",
|
|
|
|
|
]
|
|
|
|
|
|
2015-05-25 12:55:39 +02:00
|
|
|
deps = [
|
|
|
|
|
"//third_party/android_tools:cpu_features",
|
|
|
|
|
]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
2016-04-06 14:02:26 -07:00
|
|
|
|
|
|
|
|
if (is_linux) {
|
2016-09-23 00:38:52 -07:00
|
|
|
rtc_static_library("cpu_features_linux") {
|
2016-04-06 14:02:26 -07:00
|
|
|
sources = [
|
|
|
|
|
"source/cpu_features_linux.c",
|
|
|
|
|
]
|
2017-04-21 05:17:08 -07:00
|
|
|
deps = [
|
|
|
|
|
":cpu_features_api",
|
2018-07-25 16:05:48 +02:00
|
|
|
"../rtc_base/system:arch",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
2016-04-06 14:02:26 -07:00
|
|
|
}
|
|
|
|
|
}
|
2016-06-02 02:18:48 -07:00
|
|
|
|
2016-06-06 23:04:31 +02:00
|
|
|
if (rtc_include_tests) {
|
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",
|
|
|
|
|
"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 = [
|
2017-12-06 09:17:14 +01:00
|
|
|
":metrics_api",
|
2016-06-02 13:29:07 +02:00
|
|
|
":metrics_default",
|
|
|
|
|
":system_wrappers",
|
2017-04-21 05:17:08 -07:00
|
|
|
"..:webrtc_common",
|
2017-07-19 10:40:47 -07:00
|
|
|
"../rtc_base:rtc_base_approved",
|
2016-11-30 06:12:01 -08:00
|
|
|
"../test:test_main",
|
2016-06-02 13:29:07 +02:00
|
|
|
"//testing/gtest",
|
|
|
|
|
]
|
2016-06-02 02:18:48 -07:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|