Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the CocoaPods libx265/libde265 dependency, instead of vendored static library #6

Merged
merged 4 commits into from
Feb 3, 2019

Conversation

dreampiggy
Copy link
Collaborator

This is the solution to fix SDWebImage/SDWebImageBPGCoder#4.

Using vendored static library, is a idea for simple C/C++ static library which does not have Xcode project or iOS cross-compiler support. However, it make it impossible to manage the version dependency.

For example, when two Pod use the same vendored library for libx265.a, libde265.a, it cause unavoidable conflict. The solution, it's to introduce a common shared dependency. Since we already make the dependency available on CocoaPods:

So, it's time to remove the vendored library and use the CocoaPods's one instead.

@dreampiggy dreampiggy requested a review from a team February 3, 2019 14:08
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/'
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ${PODS_ROOT}/libx265/source/ is here to fix suck of libheif/heif_encoder_x265.cc, which use x265 like this:

extern "C" {
#include <x265.h>
}

@dreampiggy
Copy link
Collaborator Author

dreampiggy commented Feb 3, 2019

I run pod lib lint --use-libraries --allow-warnings, it passed. However, it seems that Travis-CI have a 10 minutes limit without any std output. 😅 It shows

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

Local test:

➜  SDWebImageHEIFCoder git:(project_libx265_dependency) pod lib lint --use-libraries --allow-warnings

 -> SDWebImageHEIFCoder (0.2.4)
...
...
    - NOTE  | [watchOS] [SDWebImageHEIFCoder/libx265] xcodebuild:  503:5: warning: not a Doxygen trailing comment [-Wdocumentation]

SDWebImageHEIFCoder passed validation.

@dreampiggy
Copy link
Collaborator Author

dreampiggy commented Feb 3, 2019

Even with that --verbose | ruby works, the build time is too long for testing. So we just check all subspecs with --no-subspecs option. 😓

@dreampiggy dreampiggy force-pushed the project_libx265_dependency branch from a2c37f8 to 4efb0bc Compare February 3, 2019 15:01
@dreampiggy dreampiggy force-pushed the project_libx265_dependency branch from 4efb0bc to d9afd0d Compare February 3, 2019 15:15
@dreampiggy dreampiggy merged commit 1155d22 into master Feb 3, 2019
@dreampiggy dreampiggy deleted the project_libx265_dependency branch February 3, 2019 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not use together with SDWebImageHEIFCoder because of libx265 static library
1 participant