TravisCI is a very useful cloud service for continous integration. It can be integrated with Github, with each commit triggering a new build and reporting back when it broke something.
Travis has support for many programming languages, among them C++. But it lacks support for C++11 features.
Travis provides basic support for C++ projects. It comes with gcc, clang, the autotools, make, cmake and scons.
While writing this post, Travis CI build machines run on Ubuntu 12.04
LTS 64 bit. This version of Ubuntu is rather old already, and does not bring
too many packages for C++11 development. For example, the default
C++ compiler installed on TravisCI is g++-4.6.3. This version
doesn’t even understand the compile option
Official C++11 support started in g++ 4.7, though C++0x features were supported way earlier. But to get decent C++11 support in g++, it is best to use g++4.8 or higher.
Fortunately TravisCI allows installing other software. To get
a more recent C++ compiler, it can simply be added from a PPA.
This can be achieved by putting the PPA in the
.travis.yml file of your
Github repository, e.g.
1 2 3 4 5 6 7 8 9 10
I have set up an example project on Github that demonstrates how to use it.