webrtc/modules/remote_bitrate_estimator/BUILD.gn
Mirko Bonadei 86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00

130 lines
3.8 KiB
Text

# 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.
import("../../webrtc.gni")
rtc_library("remote_bitrate_estimator") {
visibility = [ "*" ]
sources = [
"aimd_rate_control.cc",
"aimd_rate_control.h",
"bwe_defines.cc",
"include/bwe_defines.h",
"include/remote_bitrate_estimator.h",
"inter_arrival.cc",
"inter_arrival.h",
"overuse_detector.cc",
"overuse_detector.h",
"overuse_estimator.cc",
"overuse_estimator.h",
"remote_bitrate_estimator_abs_send_time.cc",
"remote_bitrate_estimator_abs_send_time.h",
"remote_bitrate_estimator_single_stream.cc",
"remote_bitrate_estimator_single_stream.h",
"remote_estimator_proxy.cc",
"remote_estimator_proxy.h",
"test/bwe_test_logging.h",
]
if (rtc_enable_bwe_test_logging) {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
sources += [ "test/bwe_test_logging.cc" ]
} else {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
}
deps = [
"../../api:network_state_predictor_api",
"../../api:rtp_headers",
"../../api/transport:field_trial_based_config",
"../../api/transport:network_control",
"../../api/transport:webrtc_key_value_config",
"../../api/units:data_rate",
"../../api/units:timestamp",
"../../modules:module_api",
"../../modules:module_api_public",
"../../modules/congestion_controller/goog_cc:link_capacity_estimator",
"../../modules/rtp_rtcp:rtp_rtcp_format",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_numerics",
"../../rtc_base:safe_minmax",
"../../rtc_base/experiments:field_trial_parser",
"../../system_wrappers",
"../../system_wrappers:field_trial",
"../../system_wrappers:metrics",
"//third_party/abseil-cpp/absl/types:optional",
]
}
if (!build_with_chromium) {
rtc_library("bwe_rtp") {
testonly = true
sources = [
"tools/bwe_rtp.cc",
"tools/bwe_rtp.h",
]
deps = [
":remote_bitrate_estimator",
"../../rtc_base:rtc_base_approved",
"../../test:rtp_test_utils",
"../rtp_rtcp",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
]
}
rtc_executable("rtp_to_text") {
testonly = true
sources = [
"tools/rtp_to_text.cc",
]
deps = [
":bwe_rtp",
"../../modules/rtp_rtcp",
"../../rtc_base:macromagic",
"../../rtc_base:stringutils",
"../../test:rtp_test_utils",
]
}
}
if (rtc_include_tests) {
rtc_library("remote_bitrate_estimator_unittests") {
testonly = true
sources = [
"aimd_rate_control_unittest.cc",
"inter_arrival_unittest.cc",
"overuse_detector_unittest.cc",
"remote_bitrate_estimator_abs_send_time_unittest.cc",
"remote_bitrate_estimator_single_stream_unittest.cc",
"remote_bitrate_estimator_unittest_helper.cc",
"remote_bitrate_estimator_unittest_helper.h",
"remote_estimator_proxy_unittest.cc",
]
deps = [
":remote_bitrate_estimator",
"..:module_api_public",
"../..:webrtc_common",
"../../api/transport:field_trial_based_config",
"../../api/transport:mock_network_control",
"../../api/transport:network_control",
"../../rtc_base",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers",
"../../test:field_trial",
"../../test:fileutils",
"../../test:test_support",
"../pacing",
"../rtp_rtcp:rtp_rtcp_format",
]
}
}