我正在使用此代码段在travis虚拟机中预安装所需的编译器版本
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5']
packages: ['clang-3.5']
env: COMPILER=clang++-3.5
这具有在不使用sudo
的情况下在计算机内部运行构建的优势,从而可以加快构建速度。
使用travis时,如何在Linux和osx上使用它安装cmake 2.8.12(或更新版本)?我尝试过
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5', 'add-apt-repository']
packages: ['clang-3.5', 'ppa:kalakris/cmake']
env: COMPILER=clang++-3.5
未成功
要从kalakris安装cmake,请使用:
addons:
apt:
packages:
- cmake
sources:
- kalakris-cmake
对于较新的CMake(来自https://github.com/ldionne/hana/blob/master/.travis.yml)
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake
fi
您的完整摘要是:
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7', 'kalakris-cmake']
packages: ['clang-3.7', 'cmake']
env: COMPILER=clang++-3.7