From 556caffb3631a67f2badf2ac08f87fe06850f8c3 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Fri, 19 Dec 2014 13:28:37 +0000 Subject: [PATCH] GN: Fix build for Mac BUG=4105 R=henrika@webrtc.org, pbos@webrtc.org, perkj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/29269004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7961 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/base/BUILD.gn | 4 ++-- webrtc/modules/audio_device/mac/audio_device_mac.h | 5 +++-- webrtc/modules/desktop_capture/BUILD.gn | 8 ++++++++ webrtc/modules/video_render/mac/video_render_nsopengl.h | 5 +++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index ef02817e5..4be96c2df 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -49,7 +49,7 @@ config("nss_config") { } config("ios_config") { - ldflags = [ + libs = [ #"Foundation.framework", # Already included in //build/config:default_libs. "Security.framework", "SystemConfiguration.framework", @@ -58,7 +58,7 @@ config("ios_config") { } config("mac_config") { - ldflags = [ + libs = [ "Cocoa.framework", #"Foundation.framework", # Already included in //build/config:default_libs. #"IOKit.framework", # Already included in //build/config:default_libs. diff --git a/webrtc/modules/audio_device/mac/audio_device_mac.h b/webrtc/modules/audio_device/mac/audio_device_mac.h index fae404113..31e4fc195 100644 --- a/webrtc/modules/audio_device/mac/audio_device_mac.h +++ b/webrtc/modules/audio_device/mac/audio_device_mac.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_MAC_H #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_MAC_H +#include "webrtc/base/thread_annotations.h" #include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" @@ -180,12 +181,12 @@ private: virtual int32_t MicrophoneIsAvailable(bool& available); virtual int32_t SpeakerIsAvailable(bool& available); - void Lock() + void Lock() EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); } ; - void UnLock() + void UnLock() UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); } diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn index 6c8d9e200..d8447b1f0 100644 --- a/webrtc/modules/desktop_capture/BUILD.gn +++ b/webrtc/modules/desktop_capture/BUILD.gn @@ -109,6 +109,14 @@ source_set("desktop_capture") { ] } + if (is_mac) { + libs = [ + "AppKit.framework", + "IOKit.framework", + "OpenGL.framework", + ] + } + configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config"] diff --git a/webrtc/modules/video_render/mac/video_render_nsopengl.h b/webrtc/modules/video_render/mac/video_render_nsopengl.h index c157eced1..90e3d3f07 100644 --- a/webrtc/modules/video_render/mac/video_render_nsopengl.h +++ b/webrtc/modules/video_render/mac/video_render_nsopengl.h @@ -22,6 +22,7 @@ #include #include +#include "webrtc/base/thread_annotations.h" #include "webrtc/modules/video_render/include/video_render_defines.h" #import "webrtc/modules/video_render/mac/cocoa_full_screen_window.h" @@ -119,8 +120,8 @@ public: // methods bool HasChannels(); bool HasChannel(int channel); int GetChannels(std::list& channelList); - void LockAGLCntx(); - void UnlockAGLCntx(); + void LockAGLCntx() EXCLUSIVE_LOCK_FUNCTION(_nsglContextCritSec); + void UnlockAGLCntx() UNLOCK_FUNCTION(_nsglContextCritSec); // ********** new module functions ************ // int ChangeWindow(CocoaRenderView* newWindowRef);