mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-05-31 18:24:59 +00:00
fix: add static frameworks support (#8)
This commit is contained in:
@@ -32,31 +32,28 @@ Pod::Spec.new do |s|
|
|||||||
# Cxx to Swift bridging helpers
|
# Cxx to Swift bridging helpers
|
||||||
s.public_header_files = ["ios/Video-Bridging-Header.h"]
|
s.public_header_files = ["ios/Video-Bridging-Header.h"]
|
||||||
|
|
||||||
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
s.pod_target_xcconfig = {
|
||||||
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES FOLLY_MOBILE"
|
||||||
if respond_to?(:install_modules_dependencies, true)
|
}
|
||||||
install_modules_dependencies(s)
|
|
||||||
else
|
# Try to manually add the dependencies
|
||||||
|
# because they are not automatically added by expo
|
||||||
|
# when USE_FRAMEWORKS is true
|
||||||
|
if ENV["USE_FRAMEWORKS"]
|
||||||
s.dependency "React-Core"
|
s.dependency "React-Core"
|
||||||
|
|
||||||
# Don't install the dependencies when we run `pod install` in the old architecture.
|
puts "[ReactNativeVideo] Detected USE_FRAMEWORKS, adding required dependencies..."
|
||||||
if fabric_enabled then
|
|
||||||
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
add_dependency(s, "React-jsinspector", :framework_name => "jsinspector_modern")
|
||||||
s.pod_target_xcconfig = {
|
add_dependency(s, "React-rendererconsistency", :framework_name => "React_rendererconsistency")
|
||||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
||||||
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
# @KrzysztofMoch Note: We need to add this as well for newer versions of React Native, but it's not available in older versions
|
||||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
# add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
|
||||||
}
|
|
||||||
s.dependency "React-RCTFabric"
|
|
||||||
s.dependency "React-Codegen"
|
|
||||||
s.dependency "RCT-Folly"
|
|
||||||
s.dependency "RCTRequired"
|
|
||||||
s.dependency "RCTTypeSafety"
|
|
||||||
s.dependency "ReactCommon/turbomodule/core"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add all files generated by Nitrogen
|
# Add all files generated by Nitrogen
|
||||||
load 'nitrogen/generated/ios/ReactNativeVideo+autolinking.rb'
|
load 'nitrogen/generated/ios/ReactNativeVideo+autolinking.rb'
|
||||||
add_nitrogen_files(s)
|
add_nitrogen_files(s)
|
||||||
|
|
||||||
|
install_modules_dependencies(s)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,12 @@
|
|||||||
#import "RCTFabricComponentsPlugins.h"
|
#import "RCTFabricComponentsPlugins.h"
|
||||||
|
|
||||||
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
||||||
|
|
||||||
|
#if __has_include("ReactNativeVideo/ReactNativeVideo-Swift.h")
|
||||||
|
#import "ReactNativeVideo/ReactNativeVideo-Swift.h"
|
||||||
|
#else
|
||||||
#import "ReactNativeVideo-Swift.h"
|
#import "ReactNativeVideo-Swift.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace facebook::react;
|
using namespace facebook::react;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
#import "VideoView.h"
|
#import "VideoView.h"
|
||||||
|
|
||||||
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
#import "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
|
||||||
|
|
||||||
|
#if __has_include("ReactNativeVideo/ReactNativeVideo-Swift.h")
|
||||||
|
#import "ReactNativeVideo/ReactNativeVideo-Swift.h"
|
||||||
|
#else
|
||||||
#import "ReactNativeVideo-Swift.h"
|
#import "ReactNativeVideo-Swift.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
@implementation VideoView {
|
@implementation VideoView {
|
||||||
VideoComponentView* _view;
|
VideoComponentView* _view;
|
||||||
|
|||||||
Reference in New Issue
Block a user