Compile ios helpers on mac as well.

BUG=webrtc:5582

Review-Url: https://codereview.webrtc.org/2586433002
Cr-Commit-Position: refs/heads/master@{#16604}
This commit is contained in:
kthelgason
2017-02-14 03:07:57 -08:00
committed by Commit bot
parent a3b2add27d
commit 1f16ee38c1
2 changed files with 8 additions and 4 deletions

View File

@ -47,6 +47,8 @@ if (is_ios || is_mac) {
"objc/Framework/Classes/RTCMetricsSampleInfo.mm",
"objc/Framework/Classes/RTCSSLAdapter.mm",
"objc/Framework/Classes/RTCTracing.mm",
"objc/Framework/Classes/helpers.h",
"objc/Framework/Classes/helpers.mm",
"objc/Framework/Headers/WebRTC/RTCDispatcher.h",
"objc/Framework/Headers/WebRTC/RTCFieldTrials.h",
"objc/Framework/Headers/WebRTC/RTCLogging.h",
@ -62,8 +64,6 @@ if (is_ios || is_mac) {
"objc/Framework/Classes/RTCUIApplication.h",
"objc/Framework/Classes/RTCUIApplication.mm",
"objc/Framework/Classes/UIDevice+RTCDevice.mm",
"objc/Framework/Classes/helpers.h",
"objc/Framework/Classes/helpers.mm",
"objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
"objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
]

View File

@ -8,12 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#if defined(WEBRTC_IOS)
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import <sys/sysctl.h>
#if defined(WEBRTC_IOS)
#import <UIKit/UIKit.h>
#endif
#include <memory>
@ -24,9 +25,11 @@
namespace webrtc {
namespace ios {
#if defined(WEBRTC_IOS)
bool isOperatingSystemAtLeastVersion(double version) {
return GetSystemVersion() >= version;
}
#endif
NSString* NSStringFromStdString(const std::string& stdString) {
// std::string may contain null termination character so we construct
@ -61,6 +64,7 @@ std::string GetCurrentThreadDescription() {
return StdStringFromNSString(name);
}
#if defined(WEBRTC_IOS)
std::string GetAudioSessionCategory() {
NSString* category = [[AVAudioSession sharedInstance] category];
return StdStringFromNSString(category);
@ -89,6 +93,7 @@ std::string GetDeviceType() {
NSString* deviceModel = [[UIDevice currentDevice] model];
return StdStringFromNSString(deviceModel);
}
#endif
std::string GetDeviceName() {
size_t size;
@ -134,4 +139,3 @@ bool GetLowPowerModeEnabled() {
} // namespace ios
} // namespace webrtc
#endif // defined(WEBRTC_IOS)