forked from HappySeaFox/sail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
126 lines (109 loc) · 2.7 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
language: cpp
notifications:
email: false
addons:
homebrew:
packages:
- sdl2
- giflib
- jpeg-turbo
- libpng
- libtiff
- webp
update: true
apt:
packages:
- libsdl2-dev
- libgif-dev
- libjpeg-dev
- libpng-dev
- libtiff-dev
- libwebp-dev
update: true
jobs:
include:
- os: windows
name: "Windows Server [SHARED]"
env:
- PATH="/c/SAIL/bin:$PATH"
- BUILD_SHARED_LIBS="ON"
cache:
directories:
- extra/B
- os: windows
name: "Windows Server [STATIC]"
env:
- PATH="/c/SAIL/bin:$PATH"
- BUILD_SHARED_LIBS="OFF"
cache:
directories:
- extra/B
- os: linux
dist: focal
name: "Ubuntu 20.04 Focal [SHARED]"
env:
- BUILD_SHARED_LIBS="ON"
- os: linux
dist: focal
name: "Ubuntu 20.04 Focal [STATIC]"
env:
- BUILD_SHARED_LIBS="OFF"
- os: osx
osx_image: xcode12.5
name: "macOS 11.3 [SHARED]"
env:
- CMAKE_PREFIX_PATH="/usr/local/opt/jpeg-turbo:$CMAKE_PREFIX_PATH"
before_script:
- |-
case "$TRAVIS_OS_NAME" in
windows)
# Build non-existing extra libs
if [ -d extra/B/bin ]; then
extra_bin_time=$(stat -c %Y extra/B/bin)
build_script_time=$(git log --pretty=format:%cd -n 1 --date=unix --date-order -- extra/build)
if [ $build_script_time -gt $extra_bin_time ]; then
extra/build
fi
else
extra/build
fi
;;
esac
script:
- |-
fail_on_error()
{
if [ $# -eq 0 ]; then
echo "Error: No arguments given for fail_on_error()" >&2
exit 1
fi
set -e
"$@"
set +e
}
case "$TRAVIS_OS_NAME" in
windows)
mkdir build
cd build
CMAKE_INSTALL_PREFIX="C:/SAIL"
fail_on_error cmake -A x64 -DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:-ON}" -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" -DSAIL_DEV=ON ..
fail_on_error cmake --build . --config Debug --target install
cd tests
fail_on_error ctest --verbose -C Debug
fail_on_error "$CMAKE_INSTALL_PREFIX/bin/sail" --version
;;
osx | linux)
mkdir build
cd build
CMAKE_INSTALL_PREFIX="/usr/local"
fail_on_error cmake -DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:-ON}" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" -DSAIL_DEV=ON ..
fail_on_error cmake --build .
fail_on_error sudo make install
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
fail_on_error sudo ldconfig
fi
cd tests
fail_on_error ctest --verbose
fail_on_error "$CMAKE_INSTALL_PREFIX/bin/sail" --version
;;
esac