blob: 6e1b0ae407af4a6afacd0c63380461d5bf3818c2 [file] [log] [blame]
# 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.
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
import("//testing/test.gni")
import("../build/webrtc.gni")
source_set("system_wrappers") {
sources = [
"include/aligned_array.h",
"include/aligned_malloc.h",
"include/atomic32.h",
"include/clock.h",
"include/cpu_features_wrapper.h",
"include/cpu_info.h",
"include/critical_section_wrapper.h",
"include/data_log.h",
"include/data_log_c.h",
"include/data_log_impl.h",
"include/event_wrapper.h",
"include/field_trial.h",
"include/file_wrapper.h",
"include/fix_interlocked_exchange_pointer_win.h",
"include/logging.h",
"include/metrics.h",
"include/ntp_time.h",
"include/rtp_to_ntp.h",
"include/rw_lock_wrapper.h",
"include/sleep.h",
"include/sort.h",
"include/static_instance.h",
"include/stl_util.h",
"include/stringize_macros.h",
"include/timestamp_extrapolator.h",
"include/trace.h",
"include/utf_util_win.h",
"source/aligned_malloc.cc",
"source/atomic32_win.cc",
"source/clock.cc",
"source/condition_variable_event_win.cc",
"source/condition_variable_event_win.h",
"source/cpu_features.cc",
"source/cpu_info.cc",
"source/data_log_c.cc",
"source/event.cc",
"source/event_timer_posix.cc",
"source/event_timer_posix.h",
"source/event_timer_win.cc",
"source/event_timer_win.h",
"source/file_impl.cc",
"source/logging.cc",
"source/rtp_to_ntp.cc",
"source/rw_lock.cc",
"source/rw_lock_posix.cc",
"source/rw_lock_posix.h",
"source/rw_lock_win.cc",
"source/rw_lock_win.h",
"source/rw_lock_winxp_win.cc",
"source/rw_lock_winxp_win.h",
"source/sleep.cc",
"source/sort.cc",
"source/timestamp_extrapolator.cc",
"source/trace_impl.cc",
"source/trace_impl.h",
"source/trace_posix.cc",
"source/trace_posix.h",
"source/trace_win.cc",
"source/trace_win.h",
]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
if (rtc_enable_data_logging) {
sources += [ "source/data_log.cc" ]
} else {
sources += [ "source/data_log_no_op.cc" ]
}
defines = []
libs = []
deps = [
"..:webrtc_common",
]
if (is_android) {
sources += [
"include/logcat_trace_context.h",
"source/logcat_trace_context.cc",
]
defines += [ "WEBRTC_THREAD_RR" ]
deps += [ ":cpu_features_android" ]
libs += [ "log" ]
}
if (is_linux) {
defines += [ "WEBRTC_THREAD_RR" ]
if (!build_with_chromium) {
deps += [ ":cpu_features_linux" ]
}
libs += [ "rt" ]
}
if (is_linux || is_android) {
sources += [ "source/atomic32_non_darwin_unix.cc" ]
}
if (is_ios || is_mac) {
defines += [ "WEBRTC_THREAD_RR" ]
sources += [ "source/atomic32_darwin.cc" ]
}
# TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_win) {
libs += [ "winmm.lib" ]
cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion.
}
deps += [ "../base:rtc_base_approved" ]
}
source_set("field_trial_default") {
sources = [
"include/field_trial_default.h",
"source/field_trial_default.cc",
]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
}
source_set("metrics_default") {
sources = [
"include/metrics_default.h",
"source/metrics_default.cc",
]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
}
source_set("system_wrappers_default") {
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
deps = [
":field_trial_default",
":metrics_default",
":system_wrappers",
]
}
if (is_android) {
source_set("cpu_features_android") {
sources = [
"source/cpu_features_android.c",
]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
deps = [
"//third_party/android_tools:cpu_features",
]
}
}
if (is_linux) {
source_set("cpu_features_linux") {
sources = [
"source/cpu_features_linux.c",
]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
}
}
if (rtc_include_tests) {
test("system_wrappers_unittests") {
testonly = true
sources = [
"source/aligned_array_unittest.cc",
"source/aligned_malloc_unittest.cc",
"source/clock_unittest.cc",
"source/condition_variable_unittest.cc",
"source/critical_section_unittest.cc",
"source/data_log_c_helpers_unittest.c",
"source/data_log_c_helpers_unittest.h",
"source/data_log_helpers_unittest.cc",
"source/event_timer_posix_unittest.cc",
"source/logging_unittest.cc",
"source/metrics_default_unittest.cc",
"source/metrics_unittest.cc",
"source/ntp_time_unittest.cc",
"source/rtp_to_ntp_unittest.cc",
"source/stl_util_unittest.cc",
"source/stringize_macros_unittest.cc",
]
if (rtc_enable_data_logging) {
sources += [
"source/data_log_unittest.cc",
"source/data_log_unittest_disabled.cc",
]
}
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_clang) {
# Suppress warnings from Chrome's Clang plugins.
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":metrics_default",
":system_wrappers",
"../test:test_support_main",
"//testing/gtest",
]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
}
}