llvm-project
208 строк · 6.7 Кб
1sudo: required
2dist: trusty
3language: cpp
4
5matrix:
6include:
7- compiler: gcc
8addons:
9apt:
10packages:
11- lcov
12env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage
13- compiler: gcc
14addons:
15apt:
16packages:
17- g++-multilib
18- libc6:i386
19env:
20- COMPILER=g++
21- C_COMPILER=gcc
22- BUILD_TYPE=Debug
23- BUILD_32_BITS=ON
24- EXTRA_FLAGS="-m32"
25- compiler: gcc
26addons:
27apt:
28packages:
29- g++-multilib
30- libc6:i386
31env:
32- COMPILER=g++
33- C_COMPILER=gcc
34- BUILD_TYPE=Release
35- BUILD_32_BITS=ON
36- EXTRA_FLAGS="-m32"
37- compiler: gcc
38env:
39- INSTALL_GCC6_FROM_PPA=1
40- COMPILER=g++-6 C_COMPILER=gcc-6 BUILD_TYPE=Debug
41- ENABLE_SANITIZER=1
42- EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold"
43# Clang w/ libc++
44- compiler: clang
45dist: xenial
46addons:
47apt:
48packages:
49clang-3.8
50env:
51- INSTALL_GCC6_FROM_PPA=1
52- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
53- LIBCXX_BUILD=1
54- EXTRA_CXX_FLAGS="-stdlib=libc++"
55- compiler: clang
56dist: xenial
57addons:
58apt:
59packages:
60clang-3.8
61env:
62- INSTALL_GCC6_FROM_PPA=1
63- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
64- LIBCXX_BUILD=1
65- EXTRA_CXX_FLAGS="-stdlib=libc++"
66# Clang w/ 32bit libc++
67- compiler: clang
68dist: xenial
69addons:
70apt:
71packages:
72- clang-3.8
73- g++-multilib
74- libc6:i386
75env:
76- INSTALL_GCC6_FROM_PPA=1
77- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
78- LIBCXX_BUILD=1
79- BUILD_32_BITS=ON
80- EXTRA_FLAGS="-m32"
81- EXTRA_CXX_FLAGS="-stdlib=libc++"
82# Clang w/ 32bit libc++
83- compiler: clang
84dist: xenial
85addons:
86apt:
87packages:
88- clang-3.8
89- g++-multilib
90- libc6:i386
91env:
92- INSTALL_GCC6_FROM_PPA=1
93- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
94- LIBCXX_BUILD=1
95- BUILD_32_BITS=ON
96- EXTRA_FLAGS="-m32"
97- EXTRA_CXX_FLAGS="-stdlib=libc++"
98# Clang w/ libc++, ASAN, UBSAN
99- compiler: clang
100dist: xenial
101addons:
102apt:
103packages:
104clang-3.8
105env:
106- INSTALL_GCC6_FROM_PPA=1
107- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
108- LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address"
109- ENABLE_SANITIZER=1
110- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
111- EXTRA_CXX_FLAGS="-stdlib=libc++"
112- UBSAN_OPTIONS=print_stacktrace=1
113# Clang w/ libc++ and MSAN
114- compiler: clang
115dist: xenial
116addons:
117apt:
118packages:
119clang-3.8
120env:
121- INSTALL_GCC6_FROM_PPA=1
122- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
123- LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins
124- ENABLE_SANITIZER=1
125- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
126- EXTRA_CXX_FLAGS="-stdlib=libc++"
127# Clang w/ libc++ and MSAN
128- compiler: clang
129dist: xenial
130addons:
131apt:
132packages:
133clang-3.8
134env:
135- INSTALL_GCC6_FROM_PPA=1
136- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo
137- LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread
138- ENABLE_SANITIZER=1
139- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
140- EXTRA_CXX_FLAGS="-stdlib=libc++"
141- os: osx
142osx_image: xcode8.3
143compiler: clang
144env:
145- COMPILER=clang++
146- BUILD_TYPE=Release
147- BUILD_32_BITS=ON
148- EXTRA_FLAGS="-m32"
149
150before_script:
151- if [ -n "${LIBCXX_BUILD}" ]; then
152source .libcxx-setup.sh;
153fi
154- if [ -n "${ENABLE_SANITIZER}" ]; then
155export EXTRA_OPTIONS="-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF";
156else
157export EXTRA_OPTIONS="";
158fi
159- mkdir -p build && cd build
160
161before_install:
162- if [ -z "$BUILD_32_BITS" ]; then
163export BUILD_32_BITS=OFF && echo disabling 32 bit build;
164fi
165- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
166sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test";
167sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="60";
168fi
169
170install:
171- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
172travis_wait sudo -E apt-get -yq --no-install-suggests --no-install-recommends install g++-6;
173fi
174- if [ "${TRAVIS_OS_NAME}" == "linux" -a "${BUILD_32_BITS}" == "OFF" ]; then
175travis_wait sudo -E apt-get -y --no-install-suggests --no-install-recommends install llvm-3.9-tools;
176sudo cp /usr/lib/llvm-3.9/bin/FileCheck /usr/local/bin/;
177fi
178- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
179PATH=~/.local/bin:${PATH};
180pip install --user --upgrade pip;
181travis_wait pip install --user cpp-coveralls;
182fi
183- if [ "${C_COMPILER}" == "gcc-7" -a "${TRAVIS_OS_NAME}" == "osx" ]; then
184rm -f /usr/local/include/c++;
185brew update;
186travis_wait brew install gcc@7;
187fi
188- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
189sudo apt-get update -qq;
190sudo apt-get install -qq unzip cmake3;
191wget https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-linux-x86_64.sh --output-document bazel-installer.sh;
192travis_wait sudo bash bazel-installer.sh;
193fi
194- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
195curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-darwin-x86_64.sh;
196travis_wait sudo bash bazel-installer.sh;
197fi
198
199script:
200- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_FLAGS="${EXTRA_FLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS} ${EXTRA_CXX_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
201- make
202- ctest -C ${BUILD_TYPE} --output-on-failure
203- bazel test -c dbg --define google_benchmark.have_regex=posix --announce_rc --verbose_failures --test_output=errors --keep_going //test/...
204
205after_success:
206- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
207coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .;
208fi
209