Created
July 31, 2015 16:09
-
-
Save cotsog/3ce84675af0d74438d91 to your computer and use it in GitHub Desktop.
.travis.yml for gcc-5 compiler support on Travis CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: required | |
script: | |
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc | |
- gcc --version | |
addons: | |
apt: | |
sources: | |
- ubuntu-toolchain-r-test | |
packages: | |
- gcc-5 | |
- g++-5 |
There is, from https://github.com/richelbilderbeek/travis_qmake_gcc_cpp11 :
language: cpp
compiler: gcc
dist: trusty
Then just use g++
for C++11.
If you really need g++-5 or g++6, use https://github.com/richelbilderbeek/travis_qmake_gcc_cpp14:
language: cpp
compiler: gcc
dist: trusty
before_install:
# C++14
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
# C++14
- sudo apt-get install -qq g++-6
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
I have measured this is faster than using addons
For anybody else's sake: The default g++
in Trusty fully supports C++11 language features, but the libstdc++ that's installed alongside g++-5
is the first that's feature complete for C++11 library features.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to do this without sudo?