Skip to content

Commit ced24e1

Browse files
authored
Merge pull request #41 from ctabin/travis-ci
Integration with Travis CI
2 parents ac54e12 + 0f7598a commit ced24e1

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
dist: trusty
2+
language: cpp
3+
compiler: gcc
4+
5+
matrix:
6+
include:
7+
- os: linux
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- g++-8
14+
env:
15+
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
16+
17+
before_install:
18+
- eval "${MATRIX_EVAL}"
19+
20+
install:
21+
- sudo apt-get install libbz2-dev valgrind
22+
- make libraries
23+
24+
script:
25+
- make
26+
- make tests

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CC=g++
21
CFLAGS=-W -Wall -Wextra -ansi -pedantic -std=c++0x
32
OBJ=obj
43
LIB=lib
@@ -17,21 +16,21 @@ all: libzippp-static libzippp-shared
1716
libzippp-compile:
1817
rm -rf $(OBJ)
1918
mkdir $(OBJ)
20-
$(CC) -g -fPIC -c -I$(LIBZIP)/lib -I$(LIBZIP)/build -o $(OBJ)/libzippp.o $(CFLAGS) src/libzippp.cpp
19+
$(CXX) -g -fPIC -c -I$(LIBZIP)/lib -I$(LIBZIP)/build -o $(OBJ)/libzippp.o $(CFLAGS) src/libzippp.cpp
2120

2221
libzippp-static: libzippp-compile
2322
ar rvs libzippp.a $(OBJ)/libzippp.o
2423

2524
libzippp-shared: libzippp-compile
26-
$(CC) -shared -o libzippp.so $(OBJ)/libzippp.o
25+
$(CXX) -shared -o libzippp.so $(OBJ)/libzippp.o
2726

2827
libzippp-tests: libzippp-static libzippp-shared
2928
if [ -d $(ZLIB) ]; then \
30-
$(CC) -o test_static -I$(ZLIB) -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp libzippp.a $(LIBZIP)/build/lib/libzip.a $(ZLIB)/libz.a $(CRYPTO_FLAGS); \
31-
$(CC) -o test_shared -I$(ZLIB) -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp -L. -L$(LIBZIP)/build/lib -L$(ZLIB) -lzippp -lzip -lz $(CRYPTO_FLAGS) -Wl,-rpath=.; \
29+
$(CXX) -o test_static -I$(ZLIB) -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp libzippp.a $(LIBZIP)/build/lib/libzip.a $(ZLIB)/libz.a -lbz2 $(CRYPTO_FLAGS); \
30+
$(CXX) -o test_shared -I$(ZLIB) -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp -L. -L$(LIBZIP)/build/lib -L$(ZLIB) -lzippp -lzip -lz -lbz2 $(CRYPTO_FLAGS) -Wl,-rpath=.; \
3231
else \
33-
$(CC) -o test_static -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp libzippp.a $(LIBZIP)/build/lib/libzip.a -lz $(CRYPTO_FLAGS)o; \
34-
$(CC) -o test_shared -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp -L. -L$(LIBZIP)/build/lib -lzippp -lzip -lz $(CRYPTO_FLAGS) -Wl,-rpath=.; \
32+
$(CXX) -o test_static -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp libzippp.a $(LIBZIP)/build/lib/libzip.a -lz -lbz2 $(CRYPTO_FLAGS); \
33+
$(CXX) -o test_shared -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp -L. -L$(LIBZIP)/build/lib -lzippp -lzip -lz -lbz2 $(CRYPTO_FLAGS) -Wl,-rpath=.; \
3534
fi;
3635

3736
clean-tests:

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![Build Status](https://travis-ci.org/ctabin/libzippp.svg?branch=master)](https://travis-ci.org/ctabin/libzippp)
12

23
libzippp
34
--------
@@ -20,16 +21,16 @@ Underlying libraries:
2021

2122
### LINUX
2223

23-
0. Make sure you have the following commands: ```g++``` ```make``` ```tar``` ```wget```
24-
1. Download and compile the libraries (zlib and libzip) with the command: ```make libraries```
25-
2. Then create the static and shared libraries of libzippp: ```make```
26-
3. You may want to run the tests (optional): ```make tests```
24+
0. Make sure you have the following commands: `g++` `make` `tar` `wget`
25+
1. Download and compile the libraries (zlib and libzip) with the command: `make libraries`
26+
2. Then create the static and shared libraries of libzippp: `make`
27+
3. You may want to run the tests (optional): `make tests` (`libbz2-dev` package is needed to link statically)
2728
4. Now you just have to include the src folder in your include path and
2829
link against *libzippp.a* or *libzippp.so* (do not forget to also link
2930
against libzip libraries in *lib/libzip-1.5.1/lib/.libs/*).
3031
An example of compilation with g++:
3132

32-
```Shell
33+
```shell
3334
g++ -I./lib/libzip-1.5.1/lib -I./src \
3435
main.cpp libzippp.a \
3536
lib/libzip-1.5.1/lib/.libs/libzip.a \
@@ -203,11 +204,11 @@ You might already have libzip compiled elsewhere on your system. Hence, you
203204
don't need to run 'make libzip'. Instead, just put the libzip location when
204205
you compile libzipp:
205206
206-
```Shell
207+
```shell
207208
make LIBZIP=path/to/libzip
208209
```
209210

210-
Under Debian, you'll have to install the package *zlib1g-dev* in order to compile
211+
Under Debian, you'll have to install the package `zlib1g-dev` in order to compile
211212
if you don't want to install zlib manually.
212213

213214
### WINDOWS

0 commit comments

Comments
 (0)