1language: cpp
2matrix:
3  include:
4    - os: linux
5      addons:
6        apt:
7          sources:
8            - ubuntu-toolchain-r-test
9            - sourceline: 'ppa:beineri/opt-qt593-trusty'
10          packages:
11            - qt59base valgrind
12            - g++-7
13      env:
14        - QMAKESPEC=linux-g++
15        - EVAL="CC=gcc-7 && CXX=g++-7"
16        - CFLAGS="-Os"
17        - QMAKEFLAGS="-config release"
18    - os: linux
19      addons:
20        apt:
21          sources:
22            - ubuntu-toolchain-r-test
23            - llvm-toolchain-trusty-5.0
24            - sourceline: 'ppa:beineri/opt-qt593-trusty'
25          packages:
26            - qt59base
27            - clang-5.0
28      env:
29        - QMAKESPEC=linux-clang
30        - EVAL="CC=clang-5.0 && CXX=clang++-5.0"
31        - CFLAGS="-Oz"
32        - QMAKEFLAGS="-config release"
33    - os: osx
34      env:
35        - QMAKESPEC=macx-clang
36        - CFLAGS="-Oz"
37        - QMAKEFLAGS="-config debug"
38        - PATH=/usr/local/opt/qt5/bin:$PATH
39install:
40  - if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
41        brew update;
42        brew install qt5;
43    fi
44script:
45  - PATH=`echo /opt/qt*/bin`:$PATH
46  - eval "$EVAL"
47  - make -s -f Makefile.configure configure | tee .config
48  - make -k
49        CFLAGS="$CFLAGS -march=native -g1 -Wall -Wextra -Werror"
50        CPPFLAGS="-DNDEBUG"
51        lib/libtinycbor.a
52  - size lib/libtinycbor.a
53  - make clean
54  - make -k
55        CFLAGS="$CFLAGS -O0 -g"
56  - make
57        QMAKEFLAGS="$QMAKEFLAGS QMAKE_CXX=$CXX"
58        tests/Makefile
59  - cd tests && make check -k
60        TESTRUNNER=`which valgrind 2>/dev/null`
61