.travis.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. language: c
  2. sudo: false
  3. compiler:
  4. - gcc
  5. - clang
  6. os:
  7. - linux
  8. - osx
  9. branches:
  10. only:
  11. - staging
  12. - trying
  13. - master
  14. before_script:
  15. - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew update; brew install redis; fi
  16. addons:
  17. apt:
  18. packages:
  19. - libc6-dbg
  20. - libc6-dev
  21. - libc6:i386
  22. - libc6-dev-i386
  23. - libc6-dbg:i386
  24. - gcc-multilib
  25. - g++-multilib
  26. - valgrind
  27. env:
  28. - BITS="32"
  29. - BITS="64"
  30. script:
  31. - EXTRA_CMAKE_OPTS="-DENABLE_EXAMPLES:BOOL=ON -DHIREDIS_SSL:BOOL=ON";
  32. if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  33. if [ "$BITS" == "32" ]; then
  34. CFLAGS="-m32 -Werror";
  35. CXXFLAGS="-m32 -Werror";
  36. LDFLAGS="-m32";
  37. EXTRA_CMAKE_OPTS=;
  38. else
  39. CFLAGS="-Werror";
  40. CXXFLAGS="-Werror";
  41. fi;
  42. else
  43. TEST_PREFIX="valgrind --track-origins=yes --leak-check=full";
  44. if [ "$BITS" == "32" ]; then
  45. CFLAGS="-m32 -Werror";
  46. CXXFLAGS="-m32 -Werror";
  47. LDFLAGS="-m32";
  48. EXTRA_CMAKE_OPTS=;
  49. else
  50. CFLAGS="-Werror";
  51. CXXFLAGS="-Werror";
  52. fi;
  53. fi;
  54. export CFLAGS CXXFLAGS LDFLAGS TEST_PREFIX EXTRA_CMAKE_OPTS
  55. - mkdir build/ && cd build/
  56. - cmake .. ${EXTRA_CMAKE_OPTS}
  57. - make VERBOSE=1
  58. - ctest -V
  59. matrix:
  60. include:
  61. # Windows MinGW cross compile on Linux
  62. - os: linux
  63. dist: xenial
  64. compiler: mingw
  65. addons:
  66. apt:
  67. packages:
  68. - ninja-build
  69. - gcc-mingw-w64-x86-64
  70. - g++-mingw-w64-x86-64
  71. script:
  72. - mkdir build && cd build
  73. - CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=on
  74. - ninja -v
  75. # Windows MSVC 2017
  76. - os: windows
  77. compiler: msvc
  78. env:
  79. - MATRIX_EVAL="CC=cl.exe && CXX=cl.exe"
  80. before_install:
  81. - eval "${MATRIX_EVAL}"
  82. install:
  83. - choco install ninja
  84. script:
  85. - mkdir build && cd build
  86. - cmd.exe /C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 &&
  87. cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release &&
  88. ninja -v'
  89. - ctest -V