Skip to content

Commit

Permalink
Update Travis configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
SoapGentoo committed Jun 26, 2017
1 parent ed258de commit d14d8c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 16 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@
# to allow C++11, though we are not yet building with -std=c++11

install:
- if [[ $TRAVIS_OS_NAME == osx ]]; then
brew update;
brew install python3 ninja;
python3 -m venv venv;
source venv/bin/activate;
elif [[ $TRAVIS_OS_NAME == linux ]]; then
wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip;
unzip -q ninja-linux.zip -d build;
fi
- pip3 install meson
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available.
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
- if [[ $CXX = g++ ]]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
# /usr/bin/clang has a conflict with gcc, so use clang-X.Y.
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
- if [[ $CXX = clang++ ]]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
- echo ${PATH}
- ls /usr/local
- ls /usr/local/bin
- export PATH=/usr/local/bin:/usr/bin:${PATH}
- export PATH="${PWD}"/build:/usr/local/bin:/usr/bin:${PATH}
- echo ${CXX}
- ${CXX} --version
- which valgrind
Expand All @@ -23,10 +33,7 @@ addons:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- george-edison55-precise-backports # cmake 3.2.3
packages:
- cmake
- cmake-data
- gcc-4.9
- g++-4.9
- clang-3.5
Expand All @@ -40,8 +47,9 @@ compiler:
script: ./travis.sh
env:
matrix:
- SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
- LIB_TYPE=static BUILD_TYPE=release
- LIB_TYPE=shared BUILD_TYPE=debug
notifications:
email: false
dist: trusty
sudo: false
16 changes: 4 additions & 12 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ set -vex

env | sort

cmake -DJSONCPP_WITH_CMAKE_PACKAGE=$CMAKE_PKG -DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE_MAKE .
make
cmake -DJSONCPP_WITH_CMAKE_PACKAGE=$CMAKE_PKG -DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE_MAKE -DJSONCPP_USE_SECURE_MEMORY=1 .
make

# Python is not available in Travis for osx.
# https://github.com/travis-ci/travis-ci/issues/2320
if [ "$TRAVIS_OS_NAME" != "osx" ]
then
make jsoncpp_check
valgrind --error-exitcode=42 --leak-check=full ./src/test_lib_json/jsoncpp_test
fi
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
ninja -v -C build-${LIB_TYPE}
ninja -v -C build-${LIB_TYPE} test
rm -r build-${LIB_TYPE}

0 comments on commit d14d8c3

Please sign in to comment.