Use 'default_subspec' and separate the WebP support to its sub-spec
This removes unnecessary dependency to 'libwebp' for users who don't need WebP support.
This commit is contained in:
parent
67a28d90ef
commit
bbf0b5c0e6
|
@ -17,14 +17,23 @@ Pod::Spec.new do |s|
|
|||
'and performances!'
|
||||
|
||||
s.requires_arc = true
|
||||
s.source_files = 'SDWebImage/{NS,SD,UI}*.{h,m}'
|
||||
s.framework = 'ImageIO'
|
||||
|
||||
s.default_subspec = 'Core'
|
||||
|
||||
s.dependency 'libwebp'
|
||||
s.subspec 'Core' do |core|
|
||||
core.source_files = 'SDWebImage/{NS,SD,UI}*.{h,m}'
|
||||
core.exclude_files = 'SDWebImage/UIImage+WebP.{h,m}'
|
||||
end
|
||||
|
||||
# TODO currently CocoaPods always tries to install the subspec even if the dependency is on just 'SDWebImage'
|
||||
s.subspec 'MapKit' do |mk|
|
||||
mk.source_files = 'SDWebImage/MKAnnotationView+WebCache.*'
|
||||
mk.framework = 'MapKit'
|
||||
end
|
||||
|
||||
s.subspec 'WebP' do |webp|
|
||||
webp.source_files = 'SDWebImage/UIImage+WebP.{h,m}'
|
||||
webp.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SD_WEBP=1' }
|
||||
webp.dependency 'libwebp'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue