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 <mbonadei@webrtc.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#31632}
diff --git a/BUILD.gn b/BUILD.gn
index adb78df..b676d1e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -414,7 +414,7 @@
}
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 11cf934..5de0541 100644
--- a/examples/BUILD.gn
+++ b/examples/BUILD.gn
@@ -306,7 +306,7 @@
} else {
deps += [ "../sdk:mac_framework_objc+link" ]
}
- libs = [
+ frameworks = [
"CoreMedia.framework",
"QuartzCore.framework",
]
@@ -348,7 +348,7 @@
"../sdk:ios_framework_bundle",
]
- libs = [ "AVFoundation.framework" ]
+ frameworks = [ "AVFoundation.framework" ]
}
ios_app_bundle("AppRTCMobile") {
@@ -411,7 +411,7 @@
"../sdk:ios_framework_bundle",
]
- libs = [ "ReplayKit.framework" ]
+ frameworks = [ "ReplayKit.framework" ]
}
ios_appex_bundle("AppRTCMobileBroadcastUpload") {
@@ -435,7 +435,7 @@
info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
- libs = [ "ReplayKit.framework" ]
+ frameworks = [ "ReplayKit.framework" ]
deps = [ ":AppRTCMobile_ios_bundle_data" ]
}
@@ -549,7 +549,7 @@
info_plist = "objc/AppRTCMobile/mac/Info.plist"
- libs = [ "AppKit.framework" ]
+ frameworks = [ "AppKit.framework" ]
ldflags = [
"-rpath",
@@ -594,10 +594,10 @@
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 0d1ee81..d82cef1 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -331,7 +331,7 @@
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 e49e838..431567d 100644
--- a/modules/desktop_capture/BUILD.gn
+++ b/modules/desktop_capture/BUILD.gn
@@ -262,7 +262,7 @@
"../../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 8710ed4..df6945a 100644
--- a/modules/utility/BUILD.gn
+++ b/modules/utility/BUILD.gn
@@ -26,7 +26,7 @@
}
if (is_ios) {
- libs = [ "AVFoundation.framework" ]
+ frameworks = [ "AVFoundation.framework" ]
}
deps = [
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index c62b3f6..fb341e2 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -270,7 +270,7 @@
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 @@
}
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 9886758..d30e12c9 100644
--- a/rtc_base/system/BUILD.gn
+++ b/rtc_base/system/BUILD.gn
@@ -58,7 +58,7 @@
"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 dc9b265..6092d96 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -154,7 +154,7 @@
"../rtc_base:checks",
]
- libs = [
+ frameworks = [
"AVFoundation.framework",
"CoreMedia.framework",
]
@@ -275,7 +275,7 @@
]
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 @@
public_configs = [ ":common_config_objc" ]
- libs = [ "AVFoundation.framework" ]
+ frameworks = [ "AVFoundation.framework" ]
deps = [
":base_objc",
@@ -394,7 +394,7 @@
"..:common_objc",
":used_from_extension",
]
- libs = [
+ frameworks = [
"VideoToolbox.framework",
"CoreGraphics.framework",
"CoreVideo.framework",
@@ -412,19 +412,19 @@
"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 @@
"objc/components/renderer/metal/RTCMTLVideoView.m",
]
}
- libs = [
+ frameworks = [
"CoreVideo.framework",
"Metal.framework",
"MetalKit.framework",
@@ -514,7 +514,7 @@
"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 @@
"objc/components/capturer/RTCFileVideoCapturer.m",
]
}
- libs = [
+ frameworks = [
"AVFoundation.framework",
"CoreVideo.framework",
]
@@ -1364,7 +1364,7 @@
]
}
- libs = [
+ frameworks = [
"AVFoundation.framework",
"CoreGraphics.framework",
"CoreMedia.framework",
@@ -1497,7 +1497,7 @@
]
}
- libs = [
+ frameworks = [
"AVFoundation.framework",
"CoreGraphics.framework",
"CoreMedia.framework",
@@ -1674,7 +1674,7 @@
"//third_party/libyuv",
]
- libs = [
+ frameworks = [
"CoreFoundation.framework",
"CoreMedia.framework",
"CoreVideo.framework",
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 9215b67..856b73e 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -925,7 +925,7 @@
":test_renderer_generic",
"../rtc_base:rtc_base_approved",
]
- libs = [
+ frameworks = [
"Cocoa.framework",
"OpenGL.framework",
"CoreVideo.framework",