Skip to content

Commit

Permalink
Merge pull request #6 from SDWebImage/project_libx265_dependency
Browse files Browse the repository at this point in the history
Use the CocoaPods libx265/libde265 dependency, instead of vendored static library
  • Loading branch information
dreampiggy authored Feb 3, 2019
2 parents 74565db + d9afd0d commit 1155d22
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 2,462 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ script:
- set -o pipefail

- echo Check if the library described by the podspec can be built
- pod lib lint --use-libraries --allow-warnings
# Run full subspecs linting consuming too much of build time because CocoaPods use source code of Pods
# Since`libx265` && `libde265` is Pod and have their own linting, don't waste time to lint full subspecs combination
- pod lib lint --use-libraries --allow-warnings --no-subspecs --fail-fast

- echo Build example
- pod install --project-directory=Example
Expand Down
13 changes: 1 addition & 12 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,4 @@ target 'SDWebImageHEIFCoder_Example' do


end
end

post_install do |installer|

installer.pods_project.targets.each do |target|
if target.name == "SDWebImageHEIFCoder"
target.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)', '${SRCROOT}/../../Vendors/include']
end
end
end
end
end
43 changes: 36 additions & 7 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
PODS:
- SDWebImage/Core (5.0.0-beta4)
- SDWebImageHEIFCoder/libde265 (0.2.3):
- libde265 (1.0.3)
- libx265 (3.0):
- libx265/common (= 3.0)
- libx265/core (= 3.0)
- libx265/encoder (= 3.0)
- libx265/input (= 3.0)
- libx265/output (= 3.0)
- libx265/x265 (= 3.0)
- libx265/common (3.0):
- libx265/core
- libx265/core (3.0)
- libx265/encoder (3.0):
- libx265/output
- libx265/input (3.0):
- libx265/common
- libx265/output (3.0):
- libx265/input
- libx265/x265 (3.0):
- libx265/common
- libx265/core
- libx265/encoder
- libx265/input
- libx265/output
- SDWebImage/Core (5.0.0-beta5)
- SDWebImageHEIFCoder/libde265 (0.2.4):
- libde265
- SDWebImage/Core (>= 5.0.0-beta4)
- SDWebImageHEIFCoder/libheif
- SDWebImageHEIFCoder/libheif (0.2.3):
- SDWebImageHEIFCoder/libheif (0.2.4):
- SDWebImage/Core (>= 5.0.0-beta4)
- SDWebImageHEIFCoder/libx265 (0.2.3):
- SDWebImageHEIFCoder/libx265 (0.2.4):
- libx265
- SDWebImage/Core (>= 5.0.0-beta4)
- SDWebImageHEIFCoder/libheif

Expand All @@ -15,16 +40,20 @@ DEPENDENCIES:

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- libde265
- libx265
- SDWebImage

EXTERNAL SOURCES:
SDWebImageHEIFCoder:
:path: "../"

SPEC CHECKSUMS:
SDWebImage: 56bfe1114b11f1d5766d6d0e3b3456cfd7e1e8b7
SDWebImageHEIFCoder: e632735ef0720743f80558a3eb3520b096279f9a
libde265: b2a0cc3d2aeaafb792b43fcf2a122f42e1de107c
libx265: 23ab716aae3eff1e6b68b3db6ace8883867691c4
SDWebImage: fd609df53c0f55fdcd4705bd14c01c9d5c348d0c
SDWebImageHEIFCoder: da8cf64e093c823440f844f67397fab48a0cceef

PODFILE CHECKSUM: 81286dae2d6687e2636b6da7a2f711402137c2f9
PODFILE CHECKSUM: 717a0a62a9ecf8e9cae767ce167f207323c85df8

COCOAPODS: 1.5.3
4 changes: 4 additions & 0 deletions Example/SDWebImageHEIFCoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,17 @@
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImageHEIFCoder_Example/Pods-SDWebImageHEIFCoder_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageHEIFCoder/SDWebImageHEIFCoder.framework",
"${BUILT_PRODUCTS_DIR}/libde265/libde265.framework",
"${BUILT_PRODUCTS_DIR}/libx265/libx265.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageHEIFCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libde265.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libx265.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
28 changes: 11 additions & 17 deletions SDWebImageHEIFCoder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,21 @@ Which is built based on the open-sourced libheif codec.
ss.source_files = 'Vendors/libheif/libheif/*.{h,c,cc}', 'Vendors/include/libheif/*.h', 'SDWebImageHEIFCoder/Classes/**/*', 'SDWebImageHEIFCoder/Module/SDWebImageHEIFCoder.h'
ss.exclude_files = 'Vendors/libheif/libheif/*fuzzer.{h,c,cc}', 'Vendors/libheif/libheif/heif.h', 'Vendors/libheif/libheif/heif_decoder_libde265.{h,c,cc}', 'Vendors/libheif/libheif/heif_encoder_x265.{h,c,cc}'
ss.public_header_files = 'Vendors/include/libheif/*.h', 'SDWebImageHEIFCoder/Classes/**/*.h', 'SDWebImageHEIFCoder/Module/SDWebImageHEIFCoder.h'
ss.preserve_path = 'Vendors/include'
ss.preserve_path = 'Vendors'
ss.xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) HAVE_UNISTD_H=1',
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include/libx265 ${PODS_TARGET_SRCROOT}/Vendors/include ${PODS_TARGET_SRCROOT}/Vendors/include/libx265'
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include ${PODS_TARGET_SRCROOT}/Vendors/include'
}
ss.libraries = 'c++'
end

# HEIF Decoding need libde265
s.subspec 'libde265' do |ss|
ss.dependency 'libde265'
ss.dependency 'SDWebImageHEIFCoder/libheif'
ss.source_files = 'Vendors/include/libde265/*.{h}', 'Vendors/libheif/libheif/heif_decoder_libde265.{h,c,cc}'
ss.public_header_files = 'Vendors/include/libde265/*.{h}'
ss.osx.vendored_libraries = 'Vendors/libde265/macOS/libde265.a'
ss.ios.vendored_libraries = 'Vendors/libde265/iOS/libde265.a'
ss.tvos.vendored_libraries = 'Vendors/libde265/tvOS/libde265.a'
ss.watchos.vendored_libraries = 'Vendors/libde265/watchOS/libde265.a'
ss.preserve_path = 'Vendors/include'
ss.source_files = 'Vendors/libheif/libheif/heif_decoder_libde265.{h,c,cc}'
ss.private_header_files = 'Vendors/libheif/libheif/heif_decoder_libde265.h'
ss.preserve_path = 'Vendors'
ss.xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) HAVE_LIBDE265=1',
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include'
Expand All @@ -60,17 +57,14 @@ Which is built based on the open-sourced libheif codec.

# HEIF Encoding need libx265
s.subspec 'libx265' do |ss|
ss.dependency 'libx265'
ss.dependency 'SDWebImageHEIFCoder/libheif'
ss.source_files = 'Vendors/include/libx265/*.{h}', 'Vendors/libheif/libheif/heif_encoder_x265.{h,c,cc}'
ss.public_header_files = 'Vendors/include/libx265/*.{h}'
ss.osx.vendored_libraries = 'Vendors/libx265/macOS/libx265.a'
ss.ios.vendored_libraries = 'Vendors/libx265/iOS/libx265.a'
ss.tvos.vendored_libraries = 'Vendors/libx265/tvOS/libx265.a'
ss.watchos.vendored_libraries = 'Vendors/libx265/watchOS/libx265.a'
ss.preserve_path = 'Vendors/include'
ss.source_files = 'Vendors/libheif/libheif/heif_encoder_x265.{h,c,cc}'
ss.private_header_files = 'Vendors/libheif/libheif/heif_encoder_x265.h'
ss.preserve_path = 'Vendors'
ss.xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) HAVE_X265=1',
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include'
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/SDWebImageHEIFCoder/Vendors/include ${PODS_ROOT}/libx265/source/'
}
end

Expand Down
10 changes: 0 additions & 10 deletions SDWebImageHEIFCoder/Module/SDWebImageHEIFCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
#import <SDWebImageHEIFCoder/heif.h>
#import <SDWebImageHEIFCoder/heif_version.h>
#endif
// libde265
#if __has_include(<SDWebImageHEIFCoder/de265.h>)
#import <SDWebImageHEIFCoder/de265.h>
#import <SDWebImageHEIFCoder/de265-version.h>
#endif
// libx265
#if __has_include(<SDWebImageHEIFCoder/x265.h>)
#import <SDWebImageHEIFCoder/x265.h>
#import <SDWebImageHEIFCoder/x265_config.h>
#endif

FOUNDATION_EXPORT double SDWebImageHEIFCoderVersionNumber;
FOUNDATION_EXPORT const unsigned char SDWebImageHEIFCoderVersionString[];
Expand Down
36 changes: 0 additions & 36 deletions Vendors/include/libde265/de265-version.h

This file was deleted.

Loading

0 comments on commit 1155d22

Please sign in to comment.