diff --git a/UnityFramework.podspec b/UnityFramework.podspec new file mode 100644 index 0000000..f0e3b94 --- /dev/null +++ b/UnityFramework.podspec @@ -0,0 +1,51 @@ +Pod::Spec.new do |s| + s.name = 'UnityFramework' + s.version = '1.0.0' + s.summary = 'Unity iOS Framework for Flutter integration' + s.description = 'Unity iOS framework packaged as CocoaPod for Flutter projects.' + s.homepage = 'https://gitea.sdws.shop/xim/flutter_unity_pod' + s.license = { :type => 'MIT' } + s.author = { 'xim' => 'dev@local' } + + # Git 仓库 + s.source = { :git => 'https://gitea.sdws.shop/xim/flutter_unity_pod.git', :tag => s.version.to_s } + + # iOS 13 起 + s.platform = :ios, '13.0' + + # UnityFramework.framework(注意路径包含 UnityLibrary) + s.vendored_frameworks = 'UnityLibrary/UnityFramework.framework' + + # 保留所有符号 + s.preserve_paths = [ + 'UnityLibrary/UnityFramework.framework' + ] + + # 链接依赖 + s.frameworks = [ + 'ARKit', 'AVFoundation', 'AudioToolbox', 'CoreGraphics', + 'CoreMedia', 'CoreMotion', 'CoreVideo', 'GameController', + 'Metal', 'OpenGLES', 'QuartzCore', 'UIKit', 'WebKit', + 'Security', 'MobileCoreServices' + ] + + s.libraries = 'z', 'c++' + + # 允许非模块化头 + s.pod_target_xcconfig = { + 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', + 'ENABLE_BITCODE' => 'NO', + # 模拟器排除 arm64(当 framework 不包含模拟器架构时) + 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' + } + + s.user_target_xcconfig = { + 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' + } + + # 如需同时支持真机和模拟器,请: + # 1. 从 Unity 导出模拟器版本的 framework + # 2. 使用 lipo 合并: + # lipo -create Device/UnityFramework Simulator/UnityFramework -output UnityFramework + # 3. 然后移除上面的 EXCLUDED_ARCHS 配置 +end