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:
Syo Ikeda 2013-08-14 16:02:06 +09:00
parent 67a28d90ef
commit bbf0b5c0e6
1 changed files with 12 additions and 3 deletions

View File

@ -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