-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
152 lines (146 loc) · 4.69 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
dist: focal
language: cpp
jobs:
include:
- os: linux
env: LLVM_VERSION=12.0.0
compiler: gcc
arch: amd64
- os: linux
env: LLVM_VERSION=11.0.0
compiler: gcc
arch: amd64
- os: linux
env: LLVM_VERSION=10.0.0
compiler: gcc
arch: amd64
- os: linux
env: LLVM_VERSION=9.0.0
compiler: gcc
arch: amd64
- os: linux
env: LLVM_VERSION=10.0.0
compiler: gcc
arch: s390x
- os: linux
env: LLVM_VERSION=10.0.1
compiler: gcc
arch: ppc64le
- os: linux
env: LLVM_VERSION=10.0.0
compiler: gcc
arch: arm64-graviton2
- os: osx
osx_image: xcode9.4
env: LLVM_VERSION=9.0.1
- os: osx
osx_image: xcode10.1
env: LLVM_VERSION=10.0.0
- os: windows
env: LLVM_VERSION=10.0.0
allow_failures:
- os: windows
- os: linux
env: LLVM_VERSION=11.0.0
compiler: gcc
arch: amd64
- os: linux
env: LLVM_VERSION=12.0.0
compiler: gcc
arch: amd64
cache:
directories:
- distpackages
addons:
apt:
packages:
- ninja-build
- llvm-10-dev
- llvm-10-tools
- libclang-common-10-dev
before_install:
- export DISTPACKAGES=$PWD/distpackages
- mkdir -p $DISTPACKAGES
# Should be part of addons
- |
if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
choco install visualstudio2019community visualstudio2019-workload-nativedesktop ninja python pip
export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
./scripts/vcenv.bat | sed -e 's/\\/\//g' -e 's/C:/\/c/g' -e 's/;/:/g' > /tmp/vcenv.sh
source /tmp/vcenv.sh
export CC=cl.exe
export CXX=cl.exe
export PYTHON="/c/Python38/python.exe"
export PIP="/c/Python38/Scripts/pip.exe"
else
if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then pyenv global system 3.6; fi
export PYTHON="$(which python3)"
export PIP="$(which pip3)"
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
wget -O ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip
mkdir ninja
tar -xf ninja-mac.zip -C ninja
rm ninja-mac.zip
export PATH="$PWD/ninja:$PATH"
fi
install:
- |
export LLVM_ROOT_DIR="$PWD/llvm"
mkdir -p $LLVM_ROOT_DIR
if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
export LLVMDIST_FILE=llvm-$LLVM_VERSION-windows-x64.7z
export LLVMDIST_URL=https://github.com/ldc-developers/llvm-project/releases/download/ldc-v$LLVM_VERSION/$LLVMDIST_FILE
if [ ! -e "$DISTPACKAGES/$LLVMDIST_FILE" ]; then
wget -O $DISTPACKAGES/$LLVMDIST_FILE $LLVMDIST_URL
fi
7z x $DISTPACKAGES/$LLVMDIST_FILE -o$LLVM_ROOT_DIR
export CMAKE_EXTRA_ARGS="-DCMAKE_BUILD_TYPE=Release"
elif [ "$TRAVIS_CPU_ARCH" != "s390x" ]; then
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
if [ "$TRAVIS_CPU_ARCH" == "ppc64le" ]; then
export LLVM_ARCH="powerpc64le-linux-ubuntu-16.04"
elif [ "$TRAVIS_CPU_ARCH" == "arm64" ]; then
export LLVM_ARCH="aarch64-linux-gnu"
else
if [ "$LLVM_VERSION" == "9.0.0" -o "$LLVM_VERSION" == "10.0.0" -o "$LLVM_VERSION" == "10.0.1" ]; then
export LLVM_ARCH="x86_64-linux-gnu-ubuntu-18.04"
else
export LLVM_ARCH="x86_64-linux-gnu-ubuntu-20.04"
fi
fi
else
export LLVM_ARCH="x86_64-apple-darwin"
fi
export LLVMDIST_FILE=clang+llvm-$LLVM_VERSION-${LLVM_ARCH}.tar.xz
if [ "$LLVM_VERSION" == "9.0.0" ]; then
export LLVMDIST_URL=http://releases.llvm.org/$LLVM_VERSION/$LLVMDIST_FILE
else
export LLVMDIST_URL=https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVMDIST_FILE
fi
if [ ! -e "$DISTPACKAGES/$LLVMDIST_FILE" ]; then
wget -O $DISTPACKAGES/$LLVMDIST_FILE $LLVMDIST_URL
fi
tar -xf $DISTPACKAGES/$LLVMDIST_FILE --strip 1 -C $LLVM_ROOT_DIR
fi
- |
if [ "$TRAVIS_CPU_ARCH" == "s390x" ]; then
export LLVM_CMAKE_DIR="$(llvm-config-10 --cmakedir)"
else
export LLVM_CMAKE_DIR="$($LLVM_ROOT_DIR/bin/llvm-config --cmakedir)"
fi
- echo $LLVM_CMAKE_DIR
- $PIP install --user lit
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ld --version; fi
- cmake --version
- ninja --version
- $PYTHON --version
- $PYTHON -c "import lit; lit.main();" --version . | head -n 1
script:
# Invoke CMake to generate the Ninja build files.
- export SRC_DIR="$PWD"
- mkdir ../build && cd ../build
- cmake -G Ninja -DLLVM_CMAKE_PATH=$LLVM_CMAKE_DIR -DPYTHON_EXECUTABLE=$PYTHON ${CMAKE_EXTRA_ARGS} ${SRC_DIR}
- ninja -j3 LLtool ASTtool m2lang
- bin/m2lang --version
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ninja check-all; fi