.travis.yml 3.37 KB
Newer Older
1 2 3
sudo: required
dist: precise

4
language: cpp
Milo Yip's avatar
Milo Yip committed
5 6
cache:
  - ccache
7 8

env:
9
  global:
Milo Yip's avatar
Milo Yip committed
10 11 12 13
    - USE_CCACHE=1
    - CCACHE_SLOPPINESS=pch_defines,time_macros
    - CCACHE_COMPRESS=1
    - CCACHE_MAXSIZE=100M
14 15
    - ARCH_FLAGS_x86='-m32'        # #266: don't use SSE on 32-bit
    - ARCH_FLAGS_x86_64='-msse4.2' #       use SSE4.2 on 64-bit
16
    - GITHUB_REPO='miloyip/rapidjson'
Milo Yip's avatar
Milo Yip committed
17
    - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
18

19 20 21 22 23
before_install:
    - sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
    - sudo apt-get update -qq
    - sudo apt-get install -y cmake valgrind g++-multilib libc6-dbg:i386

Milo Yip's avatar
Milo Yip committed
24 25
matrix:
  include:
Milo Yip's avatar
Milo Yip committed
26 27
    # gcc
    - env: CONF=release ARCH=x86    CXX11=ON
Milo Yip's avatar
Milo Yip committed
28
      compiler: gcc
Milo Yip's avatar
Milo Yip committed
29
    - env: CONF=release ARCH=x86_64 CXX11=ON
Milo Yip's avatar
Milo Yip committed
30
      compiler: gcc
Milo Yip's avatar
Milo Yip committed
31 32 33 34 35 36 37 38 39 40
    - env: CONF=debug   ARCH=x86    CXX11=OFF
      compiler: gcc
    - env: CONF=debug   ARCH=x86_64 CXX11=OFF
      compiler: gcc
    # clang
    - env: CONF=debug   ARCH=x86    CXX11=ON CCACHE_CPP2=yes
      compiler: clang
    - env: CONF=debug   ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
      compiler: clang
    - env: CONF=debug   ARCH=x86    CXX11=OFF CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
41
      compiler: clang
Milo Yip's avatar
Milo Yip committed
42
    - env: CONF=debug   ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
43
      compiler: clang
Milo Yip's avatar
Milo Yip committed
44
    - env: CONF=release ARCH=x86    CXX11=ON CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
45
      compiler: clang
Milo Yip's avatar
Milo Yip committed
46
    - env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
47 48
      compiler: clang
    # coverage report
Milo Yip's avatar
Milo Yip committed
49
    - env: CONF=debug   ARCH=x86    CXX11=ON GCOV_FLAGS='--coverage'
Milo Yip's avatar
Milo Yip committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
      compiler: gcc
      cache:
        - ccache
        - pip
      after_success:
        - pip install --user cpp-coveralls
        - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
    - env: CONF=debug   ARCH=x86_64 GCOV_FLAGS='--coverage'
      compiler: gcc
      cache:
        - ccache
        - pip
      after_success:
        - pip install --user cpp-coveralls
        - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
    - script: # Documentation task
      - cd build
      - cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON
      - make travis_doc
      cache: false
      addons:
        apt:
          packages:
            - doxygen
74 75

before_script:
Milo Yip's avatar
Milo Yip committed
76 77 78 79
    - ccache -s
      #   hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
      #   exposed by merging PR#163 (using -march=native)
      #   TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
80
    - sed -i "s/-march=native//" CMakeLists.txt
Milo Yip's avatar
Milo Yip committed
81
    - mkdir build
82 83

script:
84
  - if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi
Milo Yip's avatar
Milo Yip committed
85 86 87 88
  - >
      eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
      (cd build && cmake
      -DRAPIDJSON_HAS_STDSTRING=ON
Milo Yip's avatar
Milo Yip committed
89
      -DRAPIDJSON_BUILD_CXX11=$CXX11
Milo Yip's avatar
Milo Yip committed
90 91 92 93 94
      -DCMAKE_VERBOSE_MAKEFILE=ON
      -DCMAKE_BUILD_TYPE=$CONF
      -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS"
      -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS
      ..)
95
  - cd build
Milo Yip's avatar
Milo Yip committed
96 97 98
  - make tests -j 2
  - make examples -j 2
  - ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"`