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 += [