From 5c1d043726b7caa7f1e2fca598a0f2e930e035d6 Mon Sep 17 00:00:00 2001 From: kjellander Date: Thu, 9 Jun 2016 02:40:58 -0700 Subject: [PATCH] Fix GYP/GN for webrtc/modules/remote_bitrate_estimator Sync the GYP and GN targets and update the name of the GN one to 'remote_bitrate_estimator'. Move the GYP variable 'enable_bwe_test_logging' into the local scope. Remove redundant entries in modules.gyp. These are preparations related to the GN migration. BUG=webrtc:5949 TESTED=Ran GYP with the default variables and with -Denable_bwe_test_logging=1. Compiled remote_bitrate_estimator and verified that bwe_test_logging.cc is compiled only when set. NOTRY=True Review-Url: https://codereview.webrtc.org/2040313004 Cr-Commit-Position: refs/heads/master@{#13087} --- webrtc/modules/modules.gyp | 3 -- .../modules/remote_bitrate_estimator/BUILD.gn | 37 ++++++++----------- .../remote_bitrate_estimator.gypi | 18 +++++---- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/webrtc/modules/modules.gyp b/webrtc/modules/modules.gyp index fa2217db5b..efdc817dfb 100644 --- a/webrtc/modules/modules.gyp +++ b/webrtc/modules/modules.gyp @@ -399,9 +399,6 @@ 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ], }, { 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ], - 'sources!': [ - 'remote_bitrate_estimator/test/bwe_test_logging.cc' - ], }], # Run screen/window capturer tests only on platforms where they are # supported. diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn index 98a7c20104..9692c17b4b 100644 --- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn +++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn @@ -8,28 +8,15 @@ declare_args() { # Set this to true to enable BWE test logging. - enable_bwe_test_logging = false + rtc_enable_bwe_test_logging = false } source_set("remote_bitrate_estimator") { - sources = [ - "include/bwe_defines.h", - "include/remote_bitrate_estimator.h", - ] - - configs += [ "../../:common_inherited_config" ] - - deps = [ - ":rbe_components", - "../..:webrtc_common", - "../../system_wrappers", - ] -} - -source_set("rbe_components") { sources = [ "aimd_rate_control.cc", "aimd_rate_control.h", + "include/bwe_defines.h", + "include/remote_bitrate_estimator.h", "include/send_time_history.h", "inter_arrival.cc", "inter_arrival.h", @@ -38,27 +25,35 @@ source_set("rbe_components") { "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", "send_time_history.cc", + "test/bwe_test_logging.h", "transport_feedback_adapter.cc", "transport_feedback_adapter.h", ] - if (enable_bwe_test_logging) { + 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" ] } - configs += [ "../..:common_config" ] + configs += [ "../../:common_inherited_config" ] public_configs = [ "../..:common_inherited_config" ] - deps = [ - "../..:webrtc_common", - ] 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 = [ + "../..:webrtc_common", + "../../system_wrappers", + ] } diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi index 8599d671e4..b041ecaabd 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi @@ -10,6 +10,10 @@ 'includes': [ '../../build/common.gypi', ], + 'variables': { + # Set this to true to enable BWE test logging. + 'enable_bwe_test_logging%': 0, + }, 'targets': [ { 'target_name': 'remote_bitrate_estimator', @@ -39,17 +43,16 @@ 'send_time_history.cc', 'transport_feedback_adapter.cc', 'transport_feedback_adapter.h', - 'test/bwe_test_logging.cc', 'test/bwe_test_logging.h', ], # source 'conditions': [ ['enable_bwe_test_logging==1', { 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ], - }, { - 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ], - 'sources!': [ + 'sources': [ 'test/bwe_test_logging.cc' ], + }, { + 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ], }], ], }, @@ -75,7 +78,6 @@ 'test/bwe_test_fileutils.h', 'test/bwe_test_framework.cc', 'test/bwe_test_framework.h', - 'test/bwe_test_logging.cc', 'test/bwe_test_logging.h', 'test/metric_recorder.cc', 'test/metric_recorder.h', @@ -96,11 +98,11 @@ 'conditions': [ ['enable_bwe_test_logging==1', { 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ], - }, { - 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ], - 'sources!': [ + 'sources': [ 'test/bwe_test_logging.cc' ], + }, { + 'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ], }], ], },