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
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index ef02817..4be96c2 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -49,7 +49,7 @@
 }
 
 config("ios_config") {
-  ldflags = [
+  libs = [
     #"Foundation.framework",  # Already included in //build/config:default_libs.
     "Security.framework",
     "SystemConfiguration.framework",
@@ -58,7 +58,7 @@
 }
 
 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 fae4041..31e4fc1 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 @@
     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 6c8d9e2..d8447b1 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -109,6 +109,14 @@
     ]
   }
 
+  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 c157ece..90e3d3f 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 <list>
 #include <map>
 
+#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 @@
     bool HasChannels();
     bool HasChannel(int channel);
     int GetChannels(std::list<int>& channelList);
-    void LockAGLCntx();
-    void UnlockAGLCntx();
+    void LockAGLCntx() EXCLUSIVE_LOCK_FUNCTION(_nsglContextCritSec);
+    void UnlockAGLCntx() UNLOCK_FUNCTION(_nsglContextCritSec);
 
     // ********** new module functions ************ //
     int ChangeWindow(CocoaRenderView* newWindowRef);