Skip to content

Instantly share code, notes, and snippets.

@cotsog
Created July 31, 2015 16:09
Show Gist options
  • Save cotsog/3ce84675af0d74438d91 to your computer and use it in GitHub Desktop.
Save cotsog/3ce84675af0d74438d91 to your computer and use it in GitHub Desktop.
.travis.yml for gcc-5 compiler support on Travis CI
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
@richelbilderbeek
Copy link

richelbilderbeek commented Mar 14, 2017

There is, from https://github.com/richelbilderbeek/travis_qmake_gcc_cpp11 :

language: cpp
compiler: gcc
dist: trusty

Then just use g++ for C++11.

@richelbilderbeek
Copy link

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

@abigailbunyan
Copy link

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