From d75c8dcde9b0a9df6e5c092b7416c912f1000d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20H=C3=B6glund?= Date: Tue, 19 Dec 2017 09:45:24 +0100 Subject: [PATCH] Clean up duplication in APM gn file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I realized I could use configs to fix some duplication that I partially introduced. Verified APM_DEBUG_DUMP is set appropriately by looking at the compiler command line. Bug: webrtc:6828 Change-Id: Ia990e2721546d65639567cd3ab788439e328c5da Reviewed-on: https://webrtc-review.googlesource.com/34642 Reviewed-by: Per Åhgren Commit-Queue: Patrik Höglund Cr-Commit-Position: refs/heads/master@{#21349} --- modules/audio_processing/BUILD.gn | 34 +++++++++++-------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 21ba51def5..5ec09d59d4 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -17,7 +17,16 @@ declare_args() { aec_untrusted_delay_for_testing = false } +config("apm_debug_dump") { + if (apm_debug_dump) { + defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ] + } else { + defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ] + } +} + rtc_static_library("audio_processing") { + configs += [ ":apm_debug_dump" ] sources = [ "aec/aec_resampler.cc", "aec/aec_resampler.h", @@ -240,12 +249,6 @@ rtc_static_library("audio_processing") { "../audio_coding:isac", ] - if (apm_debug_dump) { - defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] - } - if (aec_untrusted_delay_for_testing) { defines += [ "WEBRTC_UNTRUSTED_DELAY" ] } @@ -383,6 +386,7 @@ if (rtc_enable_protobuf) { } rtc_source_set("apm_logging") { + configs += [ ":apm_debug_dump" ] sources = [ "logging/apm_data_dumper.cc", "logging/apm_data_dumper.h", @@ -394,14 +398,10 @@ rtc_source_set("apm_logging") { "../../rtc_base:stringutils", ] defines = [] - if (apm_debug_dump) { - defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] - } } rtc_source_set("aec_core") { + configs += [ ":apm_debug_dump" ] sources = [ "aec/aec_core.cc", "aec/aec_core.h", @@ -486,11 +486,6 @@ rtc_source_set("aec_core") { } else { sources += [ "aecm/aecm_core_c.cc" ] } - if (apm_debug_dump) { - defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] - } # TODO(jschuh): Bug 1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] @@ -524,6 +519,7 @@ if (rtc_include_tests) { rtc_source_set("audio_processing_unittests") { testonly = true + configs += [ ":apm_debug_dump" ] sources = [ "aec/echo_cancellation_unittest.cc", "aec/system_delay_unittest.cc", @@ -590,12 +586,6 @@ if (rtc_include_tests) { defines = [] - if (apm_debug_dump) { - defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] - } - if (rtc_enable_intelligibility_enhancer) { defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ] sources += [