ADD: spine-ios support Cocoapods :Static Framework (#2658)

Co-authored-by: liqiang <liqiangbj01@kanyun.com>
This commit is contained in:
kikiloveswift 2024-11-05 22:48:35 +08:00 committed by GitHub
parent 19d3d1b29b
commit 4f7fe00427
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -14,13 +14,17 @@ Spine runtimes for iOS.
s.license = { :file => 'LICENSE' }
s.source = { :git => 'https://github.com/esotericsoftware/spine-runtimes.git', :branch => '4.2' }
s.source_files = 'spine-ios/Sources/Spine/**/*.{swift,metal}'
s.source_files = 'spine-ios/Sources/Spine/**/*.{swift}'
s.platform = :ios, '13.0'
s.xcconfig = {
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp/include" "$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp-lite"'
}
s.resource_bundles = {
'SpineBundle' => ['spine-ios/Sources/Spine/**/*.{metal}']
}
s.swift_version = '5.0'
s.dependency 'SpineCppLite'
s.dependency 'SpineShadersStructs'

View File

@ -61,7 +61,8 @@ internal final class SpineRenderer: NSObject, MTKViewDelegate {
#if SWIFT_PACKAGE // SPM
bundle = .module
#else // CocoaPods
bundle = Bundle(for: SpineRenderer.self)
let bundleURL = Bundle(for: SpineRenderer.self).url(forResource: "SpineBundle", withExtension: "bundle")
bundle = Bundle(url: bundleURL!)!
#endif
let defaultLibrary = try device.makeDefaultLibrary(bundle: bundle)