From 8db4513ed38400f3be20a15b68b2dcc6aa3533ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwa=C5=9Bniewski?= Date: Thu, 9 Nov 2023 16:05:14 +0100 Subject: [PATCH] feat: support building visionOS with dynamic frameworks enabled (#28) --- packages/react-native/Libraries/Image/React-RCTImage.podspec | 2 +- .../react-native/Libraries/LinkingIOS/React-RCTLinking.podspec | 2 ++ .../Libraries/NativeAnimation/React-RCTAnimation.podspec | 2 ++ .../PushNotificationIOS/React-RCTPushNotification.podspec | 2 +- .../react/nativemodule/samples/ReactCommon-Samples.podspec | 2 ++ .../ReactCommon/react/renderer/graphics/React-graphics.podspec | 2 ++ .../rn-tester/NativeModuleExample/ScreenshotManager.podspec | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Image/React-RCTImage.podspec b/packages/react-native/Libraries/Image/React-RCTImage.podspec index 3067b80e4362f8..93ec0545c70134 100644 --- a/packages/react-native/Libraries/Image/React-RCTImage.podspec +++ b/packages/react-native/Libraries/Image/React-RCTImage.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } - s.framework = ["Accelerate", "UIKit"] + s.framework = ["Accelerate", "UIKit", "QuartzCore", "ImageIO", "CoreGraphics"] s.dependency "RCT-Folly", folly_version s.dependency "RCTTypeSafety" diff --git a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec index 6834bc2f5957a4..11a2e400e398ca 100644 --- a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec +++ b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec @@ -44,6 +44,8 @@ Pod::Spec.new do |s| "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } + s.framework = "UIKit" + s.dependency "React-Core/RCTLinkingHeaders", version s.dependency "ReactCommon/turbomodule/core", version s.dependency "React-jsi", version diff --git a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec index 3ae3f109d36d8a..05a39e37ec0dc9 100644 --- a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec +++ b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec @@ -43,6 +43,8 @@ Pod::Spec.new do |s| "HEADER_SEARCH_PATHS" => header_search_paths.join(" ") } + s.framework = ["UIKit", "QuartzCore"] + s.dependency "RCT-Folly", folly_version s.dependency "RCTTypeSafety" s.dependency "React-jsi" diff --git a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec index c0efe426e2d41a..8b929420d700c8 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +++ b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } - s.framework = "UserNotifications" + s.framework = ["UIKit", "UserNotifications"] s.dependency "RCTTypeSafety" s.dependency "React-Core/RCTPushNotificationHeaders" diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec index d694b81b61a950..e08c8da9fd9f0a 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec @@ -47,6 +47,8 @@ Pod::Spec.new do |s| "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "GCC_WARN_PEDANTIC" => "YES" } + s.framework = "UIKit" + if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' end diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec index 08052f10367bfa..67559c70383c29 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -48,6 +48,8 @@ Pod::Spec.new do |s| s.header_mappings_dir = "../../.." header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""] end + + s.framework = "UIKit" s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => header_search_paths.join(" "), diff --git a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec index 17daaf5934d9fd..3177cf590fe73a 100644 --- a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec +++ b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec @@ -21,6 +21,7 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,mm,swift}" s.requires_arc = true + s.framework = ["UIKit", "CoreGraphics"] install_modules_dependencies(s) end