Repository navigation
Expand file tree
/
Copy pathPodfile
More file actions
64 lines (53 loc) · 2.02 KB
/
Copy pathPodfile
File metadata and controls
64 lines (53 loc) · 2.02 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
63
64
require 'fileutils'
platform :ios, '15.0'
# ✅ 使用动态链接框架(App Store审核要求)
# BCLRingSDK.xcframework 本身是动态库,需要以动态方式链接
use_frameworks!
# 避免 ~/Library/Caches 无权限,强制使用项目本地缓存目录
cache_root = File.expand_path('.cocoapods_cache', __dir__)
FileUtils.mkdir_p(cache_root)
Pod::Config.instance.cache_root = Pathname.new(cache_root)
target 'OpenRing-iOS' do
# BCLRingSDK 的依赖库
# 这些库需要作为动态框架链接,以配合BCLRingSDK.xcframework
pod 'Foil', '~> 5.1.2'
pod 'iOSDFULibrary'
pod 'RxSwift', '~> 6.9.0'
pod 'RxCocoa', '~> 6.9.0'
pod 'SwiftDate'
pod 'SwiftyBeaver', '1.9.5'
pod 'Zip'
# PyTorch Mobile for AI inference
# 支持标准TorchScript模型
pod 'LibTorch', '~> 2.1.0'
# Charts for real-time data visualization
pod 'DGCharts', '~> 5.1.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Enable C++17 for all pods (required for LibTorch-Lite)
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'gnu++17'
# Ensure iOS deployment target is consistent
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
# ✅ 确保动态框架可以正常链接
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
# Override the C++ standard in the xcconfig files
installer.generated_aggregate_targets.each do |aggregate_target|
aggregate_target.xcconfigs.each do |config_name, config_file|
xcconfig_path = aggregate_target.xcconfig_path(config_name)
config_file.save_as(xcconfig_path)
# Read and modify the xcconfig file
File.open(xcconfig_path, 'r+') do |file|
content = file.read
# Replace c++14 with gnu++17
content.gsub!(/CLANG_CXX_LANGUAGE_STANDARD = c\+\+14/, 'CLANG_CXX_LANGUAGE_STANDARD = gnu++17')
file.rewind
file.write(content)
file.truncate(file.pos)
end
end
end
end