aboutsummaryrefslogtreecommitdiffhomepage
path: root/.travis.yml
blob: ceb1c3db7fc92a8cb0f4c00fcf9d184a0c1d4c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
language: cpp
dist: trusty
sudo: required
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - clang-3.6
      - g++-4.8
      - libpulse-dev
      - libasound2-dev
      - pulseaudio
      - doxygen
      - mingw-w64
      - mingw-w64-tools
env:
  global:
    - CMAKE_USE_ASAN=OFF
matrix:
  include:
    - env: C_COMPILER=clang-3.6 CXX_COMPILER=clang++-3.6
    - env: C_COMPILER=clang-3.6 CXX_COMPILER=clang++-3.6 CMAKE_USE_ASAN=ON
    - env: C_COMPILER=gcc-4.8 CXX_COMPILER=g++-4.8
    - env: SCAN_BUILD=true
    - env: CROSS=mingw
    - env: CROSS=android API_LEVEL=android-15
    - os: osx
      osx_image: xcode6.4
    - os: osx
      env: SCAN_BUILD=true
before_install:
  - if [[ -n $SCAN_BUILD ]]; then
      if [[ $TRAVIS_OS_NAME = "osx" ]]; then
        . scan-build-install.sh;
      else
        export SCAN_BUILD_PATH=/usr/share/clang/scan-build-3.6/scan-build;
      fi;
      export SCAN_BUILD_PATH="$SCAN_BUILD_PATH -o scan_results";
    fi
  - if [[ $CROSS = "android" ]]; then
      NDK=android-ndk-r13b;
      curl -LO https://dl.google.com/android/repository/$NDK-linux-x86_64.zip;
      unzip -q $NDK-linux-x86_64.zip;
      rm $NDK-linux-x86_64.zip;
      export ANDROID_NDK=$(pwd)/$NDK;
    fi
before_script:
  - if [[ -n $C_COMPILER ]]; then
      export CC=$C_COMPILER;
    fi
  - if [[ -n $CXX_COMPILER ]]; then
      export CXX=$CXX_COMPILER;
    fi
  - if [[ -n $CROSS ]]; then
      export TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-cross-$CROSS.cmake;
    fi
  - if [[ $CROSS = "android" ]]; then
      export TOOLCHAIN="$TOOLCHAIN -DANDROID_NATIVE_API_LEVEL=$API_LEVEL";
    fi
  - mkdir build && cd build
  - $SCAN_BUILD_PATH cmake -DCMAKE_BUILD_TYPE=Debug -DSANITIZE_ADDRESS=$CMAKE_USE_ASAN $TOOLCHAIN ..;
script:
  - $SCAN_BUILD_PATH cmake --build .
  - if [[ $TRAVIS_OS_NAME = "linux" && -z $CROSS ]]; then
      ctest -V;
    fi
  - if [[ -n $SCAN_BUILD ]]; then
      rmdir scan_results || ( echo "scan-build detected bugs!" && exit 1 );
    fi