forked from crystal-lang/crystal_lib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
71 lines (60 loc) · 2.13 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
language: crystal
sudo: required
matrix:
include:
- os: linux
dist: trusty
env: LLVM_VERSION=3.8
- os: linux
dist: trusty
env: LLVM_VERSION=3.9
- os: osx
osx_image: xcode8.3
env: LLVM_VERSION=3.9
- os: osx
osx_image: xcode8.3
env: LLVM_VERSION=4.0
- os: osx
osx_image: xcode8.3
env: LLVM_VERSION=5.0
- os: osx
osx_image: xcode8.3
env: LLVM_VERSION=6.0
- os: osx
osx_image: xcode8.3
env: LLVM_VERSION=7.0
before_install: |
set -e
set -x
case $TRAVIS_OS_NAME in
linux)
sudo apt-get -qq update
sudo apt-get install -y llvm-${LLVM_VERSION}-dev libclang-${LLVM_VERSION}-dev clang-${LLVM_VERSION}
# FIXME: several ugly fixes since the Travis CI image is shipped
# with a pre-configured version of LLVM:
# - /usr/bin/llvm-config is configured to point to the llvm-config
# executable that comes with the llvm-${LLVM_VERSION} package
# - the $PATH env. var. is modified to use executables from /usr/bin
# in priority to be sure that /usr/bin/llvm-config will be used to
# provide llvm-config (by default, the /usr/local/clang-VERSION/bin
# directory is present in $PATH with a better priority)
sudo update-alternatives --install /usr/bin/llvm-config llvm-config $(llvm-config-${LLVM_VERSION} --bindir)/llvm-config 1
export PATH=/usr/bin:$PATH
;;
osx)
LLVM_MAJOR_VERSION=${LLVM_VERSION:0:1}
[ $LLVM_MAJOR_VERSION -ge 4 ] && FORMULA_VERSION=$LLVM_MAJOR_VERSION || FORMULA_VERSION=$LLVM_VERSION
brew update
brew install llvm@$FORMULA_VERSION
brew link --force --overwrite llvm@$FORMULA_VERSION
# FIXME: the "libclang.dylib" shared object is manually added to the ld
# library path since the llvm the formula don't do it properly
brew list --verbose ${FORMULA:-llvm@$LLVM_VERSION} | grep "\.dylib$" | xargs -n1 -I{} ln -sf {} $(brew --prefix)/lib
;;
*)
exit 1;;
esac
# ensure the right version of clang is used by the binding
export CC=$(command -v clang-${LLVM_VERSION} || command -v clang-${LLVM_MAJOR_VERSION})
$CC --version
set +x