From bbf0b5c0e635029f46240b4ee8d39a712c12cbab Mon Sep 17 00:00:00 2001 From: Syo Ikeda Date: Wed, 14 Aug 2013 16:02:06 +0900 Subject: [PATCH] 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. --- SDWebImage.podspec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SDWebImage.podspec b/SDWebImage.podspec index 64632c48..32be0002 100644 --- a/SDWebImage.podspec +++ b/SDWebImage.podspec @@ -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