ci: add Clang package

Use flags to tell Waf what compiler to use
Don't use Make build system if compiler is Clang
This commit is contained in:
Francisco Ferreira 2016-03-09 00:52:33 +00:00 committed by Lucas De Marchi
parent 72b246e52c
commit 34de26502d
2 changed files with 25 additions and 16 deletions

View File

@ -8,6 +8,8 @@ set -ex
. ~/.profile
# CXX and CC are exported by default by travis
c_compiler=${CC:-gcc}
cxx_compiler=${CXX:-g++}
unset CXX CC
export BUILDROOT=/tmp/travis.build.$$
@ -61,6 +63,8 @@ for board in $($waf list_boards | head -n1); do waf_supported_boards[$board]=1;
echo "Targets: $CI_BUILD_TARGET"
for t in $CI_BUILD_TARGET; do
# skip make-based build for clang
if [[ "$cxx_compiler" != "clang++" ]]; then
echo "Starting make based build for target ${t}..."
for v in ${!build_platforms[@]}; do
if [[ ${build_platforms[$v]} != *$t* ]]; then
@ -77,10 +81,11 @@ for t in $CI_BUILD_TARGET; do
make $t ${build_concurrency[$t]}
popd
done
fi
if [[ -n ${waf_supported_boards[$t]} ]]; then
echo "Starting waf build for board ${t}..."
$waf configure --board $t --enable-benchmarks
$waf configure --board $t --enable-benchmarks --check-c-compiler="$c_compiler" --check-cxx-compiler="$cxx_compiler"
$waf clean
$waf ${build_concurrency[$t]} all
if [[ $t == linux ]]; then

View File

@ -4,7 +4,7 @@
set -ex
PKGS="build-essential gawk ccache genromfs libc6-i386 \
python-argparse python-empy python-serial python-pexpect python-dev python-pip zlib1g-dev gcc-4.9 g++-4.9 cmake cmake-data"
python-argparse python-empy python-serial python-pexpect python-dev python-pip zlib1g-dev gcc-4.9 g++-4.9 cmake cmake-data clang-3.7"
ARM_ROOT="gcc-arm-none-eabi-4_9-2015q3"
ARM_TARBALL="$ARM_ROOT-20150921-linux.tar.bz2"
@ -22,8 +22,12 @@ elif [ "$UBUNTU_CODENAME" = "trusty" ]; then
sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
fi
wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://llvm.org/apt/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-3.7 main" -y
sudo apt-get -qq -y update
sudo apt-get -y install $PKGS
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.7 37 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.7
sudo pip install mavproxy
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-4.9