From eec86cdd96dfae362df9d37eedeee13604fd81f3 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Mon, 8 Jul 2019 09:47:41 +0200 Subject: [PATCH] Fix platform-specific header dependencies to be more precise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the GN conditionals match what happens in sources, or the other way around. Include headers only when they're used. Bug: None Change-Id: Ib8e3346e3c24eaa7e61ac4776dcd66efe2cc5c65 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144880 Reviewed-by: Mirko Bonadei Reviewed-by: Henrik Andreassson Reviewed-by: Kári Helgason Commit-Queue: Oleh Prypin Cr-Commit-Position: refs/heads/master@{#28500} --- examples/objc/AppRTCMobile/ios/ARDVideoCallView.m | 2 ++ modules/audio_processing/BUILD.gn | 5 +++-- modules/video_processing/util/denoiser_filter.cc | 8 ++++++-- test/testsupport/file_utils.cc | 4 +--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m b/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m index a29f2cf6af..60b78c7340 100644 --- a/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m +++ b/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m @@ -13,7 +13,9 @@ #import #import +#if defined(RTC_SUPPORTS_METAL) #import +#endif #import "UIImage+ARDUtilities.h" diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 81dc2befaa..488099a259 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -302,7 +302,9 @@ rtc_source_set("file_audio_generator") { rtc_source_set("audio_processing_c") { visibility = [ ":*" ] # Only targets in this file can depend on this. - sources = [] + sources = [ + "ns/windows_private.h", + ] if (rtc_prefer_fixed_point) { sources += [ @@ -324,7 +326,6 @@ rtc_source_set("audio_processing_c") { "ns/noise_suppression.h", "ns/ns_core.c", "ns/ns_core.h", - "ns/windows_private.h", ] } diff --git a/modules/video_processing/util/denoiser_filter.cc b/modules/video_processing/util/denoiser_filter.cc index a88865b509..916afcd649 100644 --- a/modules/video_processing/util/denoiser_filter.cc +++ b/modules/video_processing/util/denoiser_filter.cc @@ -10,12 +10,16 @@ #include "modules/video_processing/util/denoiser_filter.h" #include "modules/video_processing/util/denoiser_filter_c.h" -#include "modules/video_processing/util/denoiser_filter_neon.h" -#include "modules/video_processing/util/denoiser_filter_sse2.h" #include "rtc_base/checks.h" #include "rtc_base/system/arch.h" #include "system_wrappers/include/cpu_features_wrapper.h" +#if defined(WEBRTC_ARCH_X86_FAMILY) +#include "modules/video_processing/util/denoiser_filter_sse2.h" +#elif defined(WEBRTC_HAS_NEON) +#include "modules/video_processing/util/denoiser_filter_neon.h" +#endif + namespace webrtc { const int kMotionMagnitudeThreshold = 8 * 3; diff --git a/test/testsupport/file_utils.cc b/test/testsupport/file_utils.cc index b3ef0eb732..96bd4954bf 100644 --- a/test/testsupport/file_utils.cc +++ b/test/testsupport/file_utils.cc @@ -48,9 +48,7 @@ #if defined(WEBRTC_IOS) #include "test/testsupport/ios_file_utils.h" -#endif - -#if defined(WEBRTC_MAC) +#elif defined(WEBRTC_MAC) #include "test/testsupport/mac_file_utils.h" #endif