Skip to content

Commit 759859e

Browse files
committed
Fix the podspec which cause build issue. Update the readme
1 parent 2a88de9 commit 759859e

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# libflif + Xcode
22

33
[![CI Status](http://img.shields.io/travis/SDWebImage/libflif-Xcode.svg?style=flat)](https://travis-ci.org/SDWebImage/libflif-Xcode)
4+
[![Version](https://img.shields.io/cocoapods/v/libflif.svg?style=flat)](http://cocoapods.org/pods/libflif)
5+
[![License](https://img.shields.io/cocoapods/l/libflif.svg?style=flat)](http://cocoapods.org/pods/libflif)
6+
[![Platform](https://img.shields.io/cocoapods/p/libflif.svg?style=flat)](http://cocoapods.org/pods/libflif)
47
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/libflif-Xcode)
58

6-
A wrapper for [libflif](https://github.com/FLIF-hub/FLIF) + Xcode project.
9+
A wrapper for [libflif](https://github.com/FLIF-hub/FLIF) + Xcode project. This enables Carthage support.
710

811
libflif is a codec library for [Free Lossless Image Format](https://flif.info/).
912

10-
This enables Carthage support.
13+
This repo also including the CocoaPods's spec file to use libflif with the dependency management instead of the vendored library. For CocoaPods, we use `libpng` as dependency.
1114

1215
## Requirements
1316

@@ -18,12 +21,22 @@ This enables Carthage support.
1821

1922
## Installation
2023

24+
### Carthage
25+
2126
libflif is (via this repo) available through [Carthage](https://github.com/Carthage/Carthage).
2227

2328
```
2429
github "SDWebImage/libflif-Xcode"
2530
```
2631

32+
### CocoaPods
33+
34+
libflif is available through [CocoaPods](https://github.com/CocoaPods/CocoaPods).
35+
36+
```
37+
pod 'libflif'
38+
```
39+
2740
## Usage
2841

2942
Use libflif as you would normally, this is just a repo that adds an Xcode proj.

libflif.podspec

+12
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,19 @@ FLIF is a lossless image format based on MANIAC compression.
3636
s.exclude_files = 'src/viewflif.c', 'src/flif.cpp'
3737
s.preserve_paths = 'src', 'extern'
3838

39+
# Try to fix that `flif-interface_common.cpp` using `#pragma once` in main file, which been included twice and cause duplicated symbols
40+
s.prepare_command = <<-CMD
41+
sed -i.bak 's/flif-interface_common.cpp/flif-interface_common.hpp/g' './src/library/flif-interface_dec.cpp'
42+
sed -i.bak 's/flif-interface_common.cpp/flif-interface_common.hpp/g' './src/library/flif-interface_enc.cpp'
43+
sed -i.bak 's/flif-interface_dec.cpp/flif-interface_dec.hpp/g' './src/library/flif-interface.cpp'
44+
sed -i.bak 's/flif-interface_enc.cpp/flif-interface_enc.hpp/g' './src/library/flif-interface.cpp'
45+
mv './src/library/flif-interface_common.cpp' './src/library/flif-interface_common.hpp'
46+
mv './src/library/flif-interface_dec.cpp' './src/library/flif-interface_dec.hpp'
47+
mv './src/library/flif-interface_enc.cpp' './src/library/flif-interface_enc.hpp'
48+
CMD
49+
3950
s.xcconfig = {
51+
'HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/libpng',
4052
'OTHER_CPLUSPLUSFLAGS' => '$(inherited) -ftree-vectorize',
4153
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) LODEPNG_NO_COMPILE_DISK'
4254
}

0 commit comments

Comments
 (0)