-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRNHttpServer.podspec
More file actions
62 lines (52 loc) · 2.51 KB
/
RNHttpServer.podspec
File metadata and controls
62 lines (52 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "RNHttpServer"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.platform = :ios, "13.0"
s.source = { :git => package["repository"]["url"].gsub("git+", ""), :tag => "v#{s.version}" }
s.source_files = [
"cpp/**/*.{hpp,cpp}"
]
s.dependency "React-Core"
# 添加你的 xcframework
s.vendored_frameworks = "ios/Frameworks/RNHttpServer.xcframework"
# 动态库已自包含所有依赖,无需显式链接 C++ 运行时
s.prepare_command = <<-CMD
# npm pack automatically strips symlinks, which CocoaPods strictly requires for macOS frameworks.
# Recreate symlinks for Mac Catalyst to prevent mixed linkage errors.
MACABI_FRAMEWORK="ios/Frameworks/RNHttpServer.xcframework/ios-arm64_x86_64-maccatalyst/RNHttpServer.framework"
if [ -d "$MACABI_FRAMEWORK/Versions/A" ]; then
pushd "$MACABI_FRAMEWORK" > /dev/null
# Recreate standard macOS framework symlinks.
# Deep bundles must not have Info.plist in the root to satisfy codesign.
rm -f Headers Resources RNHttpServer Info.plist
ln -sf Versions/A/Headers Headers
ln -sf Versions/A/Resources Resources
ln -sf Versions/A/RNHttpServer RNHttpServer
popd > /dev/null
fi
CMD
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => [
"\"$(PODS_ROOT)/react-native-nitro-modules/ios\"",
"\"$(PODS_ROOT)/Headers/Public/react-native-nitro-modules\"",
"\"$(PODS_TARGET_SRCROOT)/nitrogen/generated/shared/c++\"",
"\"$(PODS_TARGET_SRCROOT)/nitrogen/generated/shared\"",
"\"$(PODS_TARGET_SRCROOT)/nitrogen/generated/ios/c++\"",
"\"$(PODS_TARGET_SRCROOT)/nitrogen/generated/ios\"",
"\"$(PODS_TARGET_SRCROOT)/cpp\"",
"\"$(PODS_TARGET_SRCROOT)/ios/Frameworks/RNHttpServer.xcframework/ios-arm64/RNHttpServer.framework/Headers\"",
"\"$(PODS_TARGET_SRCROOT)/ios/Frameworks/RNHttpServer.xcframework/ios-arm64_x86_64-simulator/RNHttpServer.framework/Headers\"",
"\"$(PODS_TARGET_SRCROOT)/ios/Frameworks/RNHttpServer.xcframework/ios-arm64_x86_64-maccatalyst/RNHttpServer.framework/Headers\""
],
"OTHER_SWIFT_FLAGS" => "-cxx-interoperability-mode=default"
}
# Add all files generated by Nitrogen
load 'nitrogen/generated/ios/RNHttpServer+autolinking.rb'
add_nitrogen_files(s)
end