diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 23d8ffe165..4152448048 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -22,13 +22,12 @@ }], ], }], - # TODO(tkchin): Mac support. There are a bunch of problems right now because - # of some settings pulled down from Chromium. - ['OS=="ios"', { + ['OS=="ios" or (OS=="mac" and mac_deployment_target=="10.7")', { 'targets': [ { 'target_name': 'rtc_base_objc', 'type': 'static_library', + 'includes': [ '../build/objc_common.gypi' ], 'dependencies': [ 'rtc_base', ], @@ -60,10 +59,6 @@ }, }], ], - 'xcode_settings': { - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', - }, } ], }], # OS=="ios" diff --git a/webrtc/build/WebRTC-Prefix.pch b/webrtc/build/WebRTC-Prefix.pch new file mode 100644 index 0000000000..ab1bc7a20d --- /dev/null +++ b/webrtc/build/WebRTC-Prefix.pch @@ -0,0 +1,34 @@ +/* + * Copyright 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +#if !defined(__has_feature) || !__has_feature(nullability) +#error "This file requires nullability support." +#endif + +// The following nonnull macros were introduced in OSX SDK 10.10.3. However, +// the bots appear to be running something older. We define them here if they +// aren't already defined in NSObjCRuntime.h +#ifdef __OBJC__ + +#include + +#if !defined(NS_ASSUME_NONNULL_BEGIN) +#define NS_ASSUME_NONNULL_BEGIN +#endif + +#if !defined(NS_ASSUME_NONNULL_END) +#define NS_ASSUME_NONNULL_END +#endif + +#endif diff --git a/webrtc/build/objc_common.gypi b/webrtc/build/objc_common.gypi new file mode 100644 index 0000000000..086210ee75 --- /dev/null +++ b/webrtc/build/objc_common.gypi @@ -0,0 +1,21 @@ +# Copyright 2016 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +# ObjC target common prefix header. + +{ + 'variables': { + 'objc_prefix_file': './WebRTC-Prefix.pch', + }, + 'xcode_settings': { + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', + 'GCC_PREFIX_HEADER': '<(objc_prefix_file)', + 'GCC_PRECOMPILE_PREFIX_HEADER': 'YES' + }, +}