From 1a0c4611d7921216287c5dac0fa61b390a7ea915 Mon Sep 17 00:00:00 2001 From: sdefresne Date: Wed, 20 Apr 2016 01:44:54 -0700 Subject: [PATCH] Fix compilation of rtc_base_objc on iOS when building as part of Chromium. When building as part of Chromium, webrtc/base/logging.h is overridden by webrtc_overrides/webrtc/base/logging.h that uses Chromium logging macros. The implementation of webrtc/base/objc/RTCFileLogger.{h,mm} however has dependency on the webrtc implementation of logging as it define a class that inherits from rtc::LogSink. Since the class does not exists when the overrides are used, the file fails compilation. Fixes the compilation for iOS as part of Chromium by not compiling the file webrtc/base/objc/RTCFileLogger.{h,mm} in that configuration. BUG=459705 Review URL: https://codereview.webrtc.org/1898283002 Cr-Commit-Position: refs/heads/master@{#12438} --- webrtc/base/BUILD.gn | 9 +++++++-- webrtc/base/base.gyp | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index 0f7450cfa6..e7418d20a0 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -619,8 +619,6 @@ if (is_ios) { "objc/RTCDispatcher.m", "objc/RTCFieldTrials.h", "objc/RTCFieldTrials.mm", - "objc/RTCFileLogger.h", - "objc/RTCFileLogger.mm", "objc/RTCLogging.h", "objc/RTCLogging.mm", "objc/RTCMacros.h", @@ -631,6 +629,13 @@ if (is_ios) { "objc/RTCUIApplication.h", "objc/RTCUIApplication.mm", ] + + if (!build_with_chromium) { + sources += [ + "objc/RTCFileLogger.h", + "objc/RTCFileLogger.mm", + ] + } } } diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 3e89991fb8..a4e6bdc9d1 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -38,8 +38,6 @@ 'objc/RTCDispatcher.m', 'objc/RTCFieldTrials.h', 'objc/RTCFieldTrials.mm', - 'objc/RTCFileLogger.h', - 'objc/RTCFileLogger.mm', 'objc/RTCLogging.h', 'objc/RTCLogging.mm', 'objc/RTCMacros.h', @@ -64,6 +62,12 @@ }, }, }], + ['build_with_chromium==0', { + 'sources': [ + 'objc/RTCFileLogger.h', + 'objc/RTCFileLogger.mm', + ], + }], ], } ],