4
votes

I have a project written using Qt which support both Qt4 and Qt5.

Currently I have travis configured to compile the project using both gcc and clang on linux and OSX.

I'd like to further split this so that the project builds both Qt4 and Qt5 as separate builds as well, so 8 different permutations in total splitting on OS, compiler, and Qt version.

My current travis.yml is

language: cpp
os:
  - linux
  - osx
compiler:
  - gcc
  - clang
script: mkdir build && cd build && cmake .. -DWITH_SERVER=1 && make
install: ./travis-dependencies.sh
cache: apt

Qt4 vs Qt5 selection is configured using additional cmake parameters.

How can I change this to split my build matrix further?

1

1 Answers

2
votes

The recommendation from the Travis support team is to use environment variables to split the build:

language: cpp
env:
  - QT="-DWITH_QT4=0"
  - QT="-DWITH_QT4=1"
os:
  - linux
  - osx
compiler:
  - gcc
  - clang
script: mkdir build && cd build && cmake .. $QT -DWITH_SERVER=1 && make
install: ./travis-dependencies.sh
cache: apt