From c7f0dff19180367ea0c207b707d8bf98110a24d0 Mon Sep 17 00:00:00 2001 From: Sylvain Defresne Date: Fri, 3 Jul 2020 10:19:30 +0200 Subject: [PATCH] Convert GN libs lists to frameworks GN recently added support for Apple frameworks to link, rather than overloading the libs lists. This pulls .frameworks out of the libs lists, so that GN can stop supporting .frameworks in libs in the future. Bug: chromium:1052560 Change-Id: I263230ddd3c468061584423bba9e1f887503bcaa Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178601 Reviewed-by: Mirko Bonadei Commit-Queue: Sylvain Defresne Cr-Commit-Position: refs/heads/master@{#31632} --- BUILD.gn | 2 +- examples/BUILD.gn | 14 +++++++------- modules/audio_device/BUILD.gn | 2 +- modules/desktop_capture/BUILD.gn | 2 +- modules/utility/BUILD.gn | 2 +- rtc_base/BUILD.gn | 4 ++-- rtc_base/system/BUILD.gn | 2 +- sdk/BUILD.gn | 26 +++++++++++++------------- test/BUILD.gn | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index adb78df424..b676d1e15e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -414,7 +414,7 @@ config("common_config") { } config("common_objc") { - libs = [ "Foundation.framework" ] + frameworks = [ "Foundation.framework" ] if (rtc_use_metal_rendering) { defines = [ "RTC_SUPPORTS_METAL" ] diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 11cf934011..5de0541d9e 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -306,7 +306,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { } else { deps += [ "../sdk:mac_framework_objc+link" ] } - libs = [ + frameworks = [ "CoreMedia.framework", "QuartzCore.framework", ] @@ -348,7 +348,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { "../sdk:ios_framework_bundle", ] - libs = [ "AVFoundation.framework" ] + frameworks = [ "AVFoundation.framework" ] } ios_app_bundle("AppRTCMobile") { @@ -411,7 +411,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { "../sdk:ios_framework_bundle", ] - libs = [ "ReplayKit.framework" ] + frameworks = [ "ReplayKit.framework" ] } ios_appex_bundle("AppRTCMobileBroadcastUpload") { @@ -435,7 +435,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist" - libs = [ "ReplayKit.framework" ] + frameworks = [ "ReplayKit.framework" ] deps = [ ":AppRTCMobile_ios_bundle_data" ] } @@ -549,7 +549,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { info_plist = "objc/AppRTCMobile/mac/Info.plist" - libs = [ "AppKit.framework" ] + frameworks = [ "AppKit.framework" ] ldflags = [ "-rpath", @@ -594,10 +594,10 @@ if (is_ios || (is_mac && target_cpu != "x86")) { configs += [ ":socketrocket_warning_config" ] public_configs = [ ":socketrocket_include_config" ] - libs = [ + libs = [ "icucore" ] + frameworks = [ "CFNetwork.framework", "Security.framework", - "icucore", ] } diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn index 0d1ee81b47..d82cef1699 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -331,7 +331,7 @@ rtc_library("audio_device_impl") { if (is_mac) { rtc_source_set("audio_device_impl_frameworks") { visibility = [ ":*" ] - libs = [ + frameworks = [ # Needed for CoreGraphics: "ApplicationServices.framework", diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn index e49e8381f6..431567d53a 100644 --- a/modules/desktop_capture/BUILD.gn +++ b/modules/desktop_capture/BUILD.gn @@ -262,7 +262,7 @@ if (is_mac) { "../../rtc_base/system:rtc_export", "../../sdk:helpers_objc", ] - libs = [ + frameworks = [ "AppKit.framework", "IOKit.framework", "IOSurface.framework", diff --git a/modules/utility/BUILD.gn b/modules/utility/BUILD.gn index 8710ed4729..df6945ab2c 100644 --- a/modules/utility/BUILD.gn +++ b/modules/utility/BUILD.gn @@ -26,7 +26,7 @@ rtc_library("utility") { } if (is_ios) { - libs = [ "AVFoundation.framework" ] + frameworks = [ "AVFoundation.framework" ] } deps = [ diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index c62b3f6afe..fb341e2502 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -270,7 +270,7 @@ rtc_library("logging") { deps += [ "system:inline" ] if (is_mac) { - libs += [ "Foundation.framework" ] + frameworks = [ "Foundation.framework" ] } # logging.h needs the deprecation header while downstream projects are @@ -962,7 +962,7 @@ rtc_library("rtc_base") { } if (is_ios) { - libs += [ + frameworks = [ "CFNetwork.framework", "Foundation.framework", "Security.framework", diff --git a/rtc_base/system/BUILD.gn b/rtc_base/system/BUILD.gn index 98867588cc..d30e12c94d 100644 --- a/rtc_base/system/BUILD.gn +++ b/rtc_base/system/BUILD.gn @@ -58,7 +58,7 @@ if (is_mac || is_ios) { "cocoa_threading.mm", ] deps = [ "..:checks" ] - libs = [ "Foundation.framework" ] + frameworks = [ "Foundation.framework" ] } rtc_library("gcd_helpers") { diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index dc9b265155..6092d96e02 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -154,7 +154,7 @@ if (is_ios || is_mac) { "../rtc_base:checks", ] - libs = [ + frameworks = [ "AVFoundation.framework", "CoreMedia.framework", ] @@ -275,7 +275,7 @@ if (is_ios || is_mac) { ] absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ] - libs = [ "AudioToolbox.framework" ] + frameworks = [ "AudioToolbox.framework" ] } # This target exists to expose :audio_session_objc and @@ -327,7 +327,7 @@ if (is_ios || is_mac) { public_configs = [ ":common_config_objc" ] - libs = [ "AVFoundation.framework" ] + frameworks = [ "AVFoundation.framework" ] deps = [ ":base_objc", @@ -394,7 +394,7 @@ if (is_ios || is_mac) { "..:common_objc", ":used_from_extension", ] - libs = [ + frameworks = [ "VideoToolbox.framework", "CoreGraphics.framework", "CoreVideo.framework", @@ -412,19 +412,19 @@ if (is_ios || is_mac) { "objc/components/renderer/opengl/RTCShader.mm", "objc/components/renderer/opengl/RTCVideoViewShading.h", ] - libs = [ "CoreVideo.framework" ] + frameworks = [ "CoreVideo.framework" ] if (is_ios) { sources += [ "objc/components/renderer/opengl/RTCNV12TextureCache.h", "objc/components/renderer/opengl/RTCNV12TextureCache.m", ] - libs += [ + frameworks += [ "GLKit.framework", "OpenGLES.framework", "QuartzCore.framework", ] } else if (is_mac) { - libs += [ + frameworks += [ "CoreMedia.framework", "OpenGL.framework", ] @@ -504,7 +504,7 @@ if (is_ios || is_mac) { "objc/components/renderer/metal/RTCMTLVideoView.m", ] } - libs = [ + frameworks = [ "CoreVideo.framework", "Metal.framework", "MetalKit.framework", @@ -514,7 +514,7 @@ if (is_ios || is_mac) { "objc/components/renderer/metal/RTCMTLNSVideoView.h", "objc/components/renderer/metal/RTCMTLNSVideoView.m", ] - libs += [ "AppKit.framework" ] + frameworks += [ "AppKit.framework" ] } deps = [ ":base_objc", @@ -559,7 +559,7 @@ if (is_ios || is_mac) { "objc/components/capturer/RTCFileVideoCapturer.m", ] } - libs = [ + frameworks = [ "AVFoundation.framework", "CoreVideo.framework", ] @@ -1364,7 +1364,7 @@ if (is_ios || is_mac) { ] } - libs = [ + frameworks = [ "AVFoundation.framework", "CoreGraphics.framework", "CoreMedia.framework", @@ -1497,7 +1497,7 @@ if (is_ios || is_mac) { ] } - libs = [ + frameworks = [ "AVFoundation.framework", "CoreGraphics.framework", "CoreMedia.framework", @@ -1674,7 +1674,7 @@ if (is_ios || is_mac) { "//third_party/libyuv", ] - libs = [ + frameworks = [ "CoreFoundation.framework", "CoreMedia.framework", "CoreVideo.framework", diff --git a/test/BUILD.gn b/test/BUILD.gn index 9215b679ce..856b73e815 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -925,7 +925,7 @@ if (is_mac) { ":test_renderer_generic", "../rtc_base:rtc_base_approved", ] - libs = [ + frameworks = [ "Cocoa.framework", "OpenGL.framework", "CoreVideo.framework",