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") {
|
2014-06-21 14:25:16 +00:00
|
|
|
sources = [
|
2015-10-28 18:17:40 +01:00
|
|
|
"include/aligned_array.h",
|
|
|
|
|
"include/aligned_malloc.h",
|
|
|
|
|
"include/atomic32.h",
|
|
|
|
|
"include/clock.h",
|
|
|
|
|
"include/cpu_info.h",
|
|
|
|
|
"include/event_wrapper.h",
|
|
|
|
|
"include/file_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/rw_lock_wrapper.h",
|
|
|
|
|
"include/sleep.h",
|
|
|
|
|
"include/timestamp_extrapolator.h",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/aligned_malloc.cc",
|
2017-10-20 15:47:42 -07:00
|
|
|
"source/atomic32.cc",
|
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",
|
2015-04-08 11:24:19 +02:00
|
|
|
"source/event_timer_posix.cc",
|
|
|
|
|
"source/event_timer_posix.h",
|
|
|
|
|
"source/event_timer_win.cc",
|
|
|
|
|
"source/event_timer_win.h",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/file_impl.cc",
|
2016-12-22 07:53:51 -08:00
|
|
|
"source/rtp_to_ntp_estimator.cc",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/rw_lock.cc",
|
2015-02-07 22:35:54 +00:00
|
|
|
"source/rw_lock_posix.cc",
|
|
|
|
|
"source/rw_lock_posix.h",
|
|
|
|
|
"source/rw_lock_win.cc",
|
|
|
|
|
"source/rw_lock_win.h",
|
2014-06-21 14:25:16 +00:00
|
|
|
"source/sleep.cc",
|
|
|
|
|
"source/timestamp_extrapolator.cc",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
|
libs = []
|
2015-05-25 12:55:39 +02:00
|
|
|
deps = [
|
|
|
|
|
"..:webrtc_common",
|
2017-11-14 10:32:15 +01:00
|
|
|
"../api:optional",
|
|
|
|
|
"../modules:module_api_public",
|
2015-05-25 12:55:39 +02:00
|
|
|
]
|
2017-04-21 05:17:08 -07:00
|
|
|
public_deps = [
|
|
|
|
|
":cpu_features_api",
|
|
|
|
|
":field_trial_api",
|
|
|
|
|
":metrics_api",
|
|
|
|
|
]
|
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
|
|
|
|
2014-06-29 13:37:08 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2016-06-02 02:09:52 -07:00
|
|
|
# TODO(jschuh): Bug 1348: fix this warning.
|
|
|
|
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
|
|
|
|
|
2014-06-21 14:25:16 +00:00
|
|
|
if (is_win) {
|
|
|
|
|
libs += [ "winmm.lib" ]
|
|
|
|
|
|
2016-06-02 02:09:52 -07:00
|
|
|
cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion.
|
2017-04-21 05:17:08 -07:00
|
|
|
|
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.
|
2017-04-21 05:17:08 -07:00
|
|
|
# TODO(kjellander): Remove (bugs.webrtc.org/6828)
|
2017-07-19 10:40:47 -07:00
|
|
|
deps += [ "../rtc_base:rtc_base" ]
|
2014-06-21 14:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
2016-08-29 02:56:06 -07:00
|
|
|
if (is_win && is_clang) {
|
2016-08-26 13:31:24 -07:00
|
|
|
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
2016-08-26 13:31:24 -07: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",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 14:59:17 -07:00
|
|
|
rtc_source_set("asm_defines") {
|
|
|
|
|
sources = [
|
|
|
|
|
"include/asm_defines.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 05:17:08 -07:00
|
|
|
rtc_source_set("field_trial_api") {
|
|
|
|
|
sources = [
|
|
|
|
|
"include/field_trial.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc_source_set("metrics_api") {
|
|
|
|
|
sources = [
|
|
|
|
|
"include/metrics.h",
|
|
|
|
|
]
|
|
|
|
|
deps = [
|
|
|
|
|
"..:webrtc_common",
|
2017-07-19 10:40:47 -07:00
|
|
|
"../rtc_base:rtc_base_approved",
|
2017-04-21 05:17:08 -07:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-26 11:43:59 +02:00
|
|
|
rtc_source_set("field_trial_default") {
|
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
|
|
|
}
|
|
|
|
|
|
2017-10-26 11:43:59 +02:00
|
|
|
rtc_source_set("metrics_default") {
|
2014-10-23 12:57:56 +00:00
|
|
|
sources = [
|
2016-05-20 06:29:46 -07:00
|
|
|
"include/metrics_default.h",
|
2014-10-23 12:57:56 +00:00
|
|
|
"source/metrics_default.cc",
|
|
|
|
|
]
|
2017-04-21 05:17:08 -07:00
|
|
|
deps = [
|
|
|
|
|
":metrics_api",
|
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
|
|
|
}
|
|
|
|
|
|
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",
|
2015-11-23 14:47:56 -08:00
|
|
|
":system_wrappers",
|
2014-10-23 12:57:56 +00:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-21 14:25:16 +00:00
|
|
|
if (is_android) {
|
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",
|
|
|
|
|
]
|
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/aligned_array_unittest.cc",
|
|
|
|
|
"source/aligned_malloc_unittest.cc",
|
|
|
|
|
"source/clock_unittest.cc",
|
|
|
|
|
"source/event_timer_posix_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
|
|
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
2016-06-02 02:18:48 -07:00
|
|
|
|
2016-10-16 23:56:12 -07:00
|
|
|
if (!build_with_chromium && is_clang) {
|
|
|
|
|
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
2016-09-02 04:10:34 -07:00
|
|
|
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
2016-06-02 13:29:07 +02:00
|
|
|
}
|
2016-06-02 02:18:48 -07:00
|
|
|
|
2016-06-02 13:29:07 +02:00
|
|
|
deps = [
|
|
|
|
|
":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
|
|
|
}
|
|
|
|
|
}
|