Skip to content

Commit 6466701

Browse files
committed
travis: add jobs for linking dependent libraries statically
1 parent 656cae3 commit 6466701

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.travis.yml

+30
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
dist: trusty
22
sudo: required
33
language: cpp
4+
addons:
45
matrix:
56
include:
67
- os: osx
8+
- os: osx
9+
env: STATIC=1
710
- os: linux
811
addons:
912
apt:
@@ -26,6 +29,21 @@ matrix:
2629
build_command_prepend: cov-configure --compiler /usr/bin/g++-7 --comptype g++ -- -march=native -fPIC -std=gnu++14 && cmake -DMKLDNN_INCLUDE_DIR="$HOME/mkl-dnn/include" -DMKLDNN_LIBRARY="$HOME/mkl-dnn/lib/libmkldnn.so" .
2730
build_command: make
2831
branch_pattern: coverity_scan
32+
- os: linux
33+
env: STATIC=1
34+
addons:
35+
apt:
36+
sources:
37+
- ubuntu-toolchain-r-test
38+
- sourceline: 'ppa:maarten-fonville/protobuf'
39+
packages:
40+
- gcc-7
41+
- g++-7
42+
- cmake-data
43+
- cmake
44+
- libopencv-dev
45+
- libprotobuf-dev
46+
- protobuf-compiler
2947
env:
3048
global:
3149
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
@@ -73,16 +91,28 @@ script:
7391
#- if [ -f cov-int/build-log.txt ]; then cat cov-int/build-log.txt; fi
7492
# CMakeCache.txt generated for coverity_scan build hinders out-of-source build
7593
- if [ -f CMakeCache.txt ]; then rm CMakeCache.txt; fi
94+
- |
95+
if [ -n "$STATIC" ]; then
96+
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
97+
STATIC_OPTION="-DLINK_STATIC_LIBPROTOBUF=ON"
98+
else
99+
STATIC_OPTION="-DLINK_STATIC_LIBPROTOBUF=ON -DLINK_STATIC_LIBSTDCXX=ON -DLINK_STATIC_LIBGCC=ON"
100+
fi
101+
else
102+
STATIC_OPTION=""
103+
fi
76104
- mkdir build
77105
- cd build
78106
- |
79107
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
80108
cmake -DENABLE_TEST=ON \
109+
$STATIC_OPTION \
81110
..
82111
else
83112
cmake -DENABLE_TEST=ON \
84113
-DMKLDNN_INCLUDE_DIR="$HOME/mkl-dnn/include" \
85114
-DMKLDNN_LIBRARY="$HOME/mkl-dnn/lib/libmkldnn.so" \
115+
$STATIC_OPTION \
86116
..
87117
fi
88118
- make

0 commit comments

Comments
 (0)