From 407bfbf651906d2d9be63b0c90996e1de01e5b19 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 13 Oct 2015 17:27:17 +0530 Subject: [PATCH] build: Make build succeed without test and non-audio deps --- configure.ac | 5 +++-- webrtc/common_audio/channel_buffer.h | 2 ++ webrtc/common_audio/resampler/sinc_resampler.h | 4 ++++ .../intelligibility/intelligibility_enhancer.h | 2 ++ .../audio_processing/transient/transient_suppressor.h | 4 ++++ webrtc/modules/interface/module_common_types.h | 6 ++++++ 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 13d4ee1..8c4916e 100644 --- a/configure.ac +++ b/configure.ac @@ -24,8 +24,9 @@ AS_CASE(["x${with_ns_mode}"], [NS_FIXED=0]) AM_CONDITIONAL(NS_FIXED, [test "x${NS_FIXED}" = "x1"]) -COMMON_CFLAGS="-DWEBRTC_POSIX -DWEBRTC_LINUX -DNDEBUG -I\$(top_srcdir)" -COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_POSIX -DWEBRTC_LINUX -DNDEBUG -I\$(top_srcdir)" +# FIXME: POSIX and LINUX should not be hard-coded +COMMON_CFLAGS="-DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DNDEBUG -I\$(top_srcdir)" +COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DNDEBUG -I\$(top_srcdir)" AC_SUBST([COMMON_CFLAGS]) AC_SUBST([COMMON_CXXFLAGS]) diff --git a/webrtc/common_audio/channel_buffer.h b/webrtc/common_audio/channel_buffer.h index 6050090..a308d7b 100644 --- a/webrtc/common_audio/channel_buffer.h +++ b/webrtc/common_audio/channel_buffer.h @@ -16,7 +16,9 @@ #include "webrtc/base/checks.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/common_audio/include/audio_util.h" +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD #include "webrtc/test/testsupport/gtest_prod_util.h" +#endif namespace webrtc { diff --git a/webrtc/common_audio/resampler/sinc_resampler.h b/webrtc/common_audio/resampler/sinc_resampler.h index 189112b..95ce44e 100644 --- a/webrtc/common_audio/resampler/sinc_resampler.h +++ b/webrtc/common_audio/resampler/sinc_resampler.h @@ -17,7 +17,9 @@ #include "webrtc/base/constructormagic.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/system_wrappers/interface/aligned_malloc.h" +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD #include "webrtc/test/testsupport/gtest_prod_util.h" +#endif #include "webrtc/typedefs.h" namespace webrtc { @@ -85,8 +87,10 @@ class SincResampler { float* get_kernel_for_testing() { return kernel_storage_.get(); } private: +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve); FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, ConvolveBenchmark); +#endif void InitializeKernel(); void UpdateRegions(bool second_load); diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h index 1e9e35a..0215426 100644 --- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h +++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h @@ -95,8 +95,10 @@ class IntelligibilityEnhancer { AudioSource source_; }; friend class TransformCallback; +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestErbCreation); FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestSolveForGains); +#endif // Sends streams to ProcessClearBlock or ProcessNoiseBlock based on source. void DispatchAudio(AudioSource source, diff --git a/webrtc/modules/audio_processing/transient/transient_suppressor.h b/webrtc/modules/audio_processing/transient/transient_suppressor.h index 5a6f117..b62dcde 100644 --- a/webrtc/modules/audio_processing/transient/transient_suppressor.h +++ b/webrtc/modules/audio_processing/transient/transient_suppressor.h @@ -15,7 +15,9 @@ #include #include "webrtc/base/scoped_ptr.h" +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD #include "webrtc/test/testsupport/gtest_prod_util.h" +#endif #include "webrtc/typedefs.h" namespace webrtc { @@ -59,8 +61,10 @@ class TransientSuppressor { bool key_pressed); private: +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD FRIEND_TEST_ALL_PREFIXES(TransientSuppressorTest, TypingDetectionLogicWorksAsExpectedForMono); +#endif void Suppress(float* in_ptr, float* spectral_mean, float* out_ptr); void UpdateKeypress(bool key_pressed); diff --git a/webrtc/modules/interface/module_common_types.h b/webrtc/modules/interface/module_common_types.h index 67019ca..18699d8 100644 --- a/webrtc/modules/interface/module_common_types.h +++ b/webrtc/modules/interface/module_common_types.h @@ -19,7 +19,9 @@ #include "webrtc/base/constructormagic.h" #include "webrtc/common_types.h" +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD #include "webrtc/common_video/rotation.h" +#endif #include "webrtc/typedefs.h" namespace webrtc { @@ -233,6 +235,7 @@ enum RtpVideoCodecTypes { kRtpVideoVp9, kRtpVideoH264 }; +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD // Since RTPVideoHeader is used as a member of a union, it can't have a // non-trivial default constructor. struct RTPVideoHeader { @@ -246,9 +249,12 @@ struct RTPVideoHeader { RtpVideoCodecTypes codec; RTPVideoTypeHeader codecHeader; }; +#endif union RTPTypeHeader { RTPAudioHeader Audio; +#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD RTPVideoHeader Video; +#endif }; struct WebRtcRTPHeader {