From 054b10882001974e419a808eea995f6d38a33ba3 Mon Sep 17 00:00:00 2001 From: mbonadei Date: Mon, 4 Sep 2017 06:54:54 -0700 Subject: [PATCH] Decoupling video_capture_internal_imlp from Obj-C code The goal of this CL is to separate Obj-C/Obj-C++ code from targets which have also C++ code (see https://bugs.chromium.org/p/webrtc/issues/detail?id=7743 for more information). BUG=webrtc:7743 NOTRY=True Review-Url: https://codereview.webrtc.org/2992953002 Cr-Commit-Position: refs/heads/master@{#19662} --- webrtc/modules/video_capture/BUILD.gn | 44 ++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn index b382ca0670..5176862c42 100644 --- a/webrtc/modules/video_capture/BUILD.gn +++ b/webrtc/modules/video_capture/BUILD.gn @@ -86,7 +86,38 @@ if (!build_with_chromium) { } } - rtc_static_library("video_capture_internal_impl") { + if (is_ios || is_mac) { + rtc_source_set("video_capture_internal_impl_objc") { + visibility = [ ":video_capture_internal_impl" ] + configs += [ ":video_capture_internal_impl_warnings_config" ] + + deps = [ + ":video_capture_module", + "../../rtc_base:rtc_base_approved", + "../../system_wrappers", + ] + + sources = [ + "objc/device_info.h", + "objc/device_info.mm", + "objc/device_info_objc.h", + "objc/device_info_objc.mm", + "objc/rtc_video_capture_objc.h", + "objc/rtc_video_capture_objc.mm", + "objc/video_capture.h", + "objc/video_capture.mm", + ] + + all_dependent_configs = [ ":video_capture_internal_impl_config" ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + } + } + + rtc_source_set("video_capture_internal_impl") { configs += [ ":video_capture_internal_impl_warnings_config" ] deps = [ @@ -129,16 +160,7 @@ if (!build_with_chromium) { deps += [ "//third_party/winsdk_samples" ] } if (is_ios || is_mac) { - sources = [ - "objc/device_info.h", - "objc/device_info.mm", - "objc/device_info_objc.h", - "objc/device_info_objc.mm", - "objc/rtc_video_capture_objc.h", - "objc/rtc_video_capture_objc.mm", - "objc/video_capture.h", - "objc/video_capture.mm", - ] + deps += [ ":video_capture_internal_impl_objc" ] } all_dependent_configs = [ ":video_capture_internal_impl_config" ]