I have recently been adding Travis CI builds to code that I host on GitHub, so that I don’t need to host my own build infrastructure.
To users, this just means that there is a green badge at the top of the README, but not much else:
To build a simple C++ project, I added in this .travis.yml
file:
|
|
Unfortunately the default build tools are ancient on this infrastructure, which uses Ubuntu Precise (12.04):
|
|
Option 1: Update the toolchain
There is some structures you can use to install an extra repository and some named packages, instead of using apt-get
directly.
|
|
Because the old version was still installed, I had to refer to the exact version in the Makefile
, as in:
|
|
Option 2: Update the platform
You can also change to a more recent Ubuntu distribution. Presumably Ubuntu Precise is only the default because existing builds use it.
If you need to build C++11 apps on Travis CI, then builds will work under Ubuntu Trusty (14.04), which happens to be the newest distribution currently available:
|
|