Files
ArduinoJson/scripts/travis/cmake.sh

34 lines
720 B
Bash
Raw Normal View History

#!/bin/sh -ex
2016-05-15 09:41:53 +02:00
2019-02-27 17:41:40 +01:00
if [ "$(uname)" = 'Darwin' ]; then
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz
CMAKE=/tmp/CMake.app/Contents/bin/cmake
CTEST=/tmp/CMake.app/Contents/bin/ctest
else
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz
CMAKE=/tmp/bin/cmake
CTEST=/tmp/bin/ctest
fi
2016-05-15 09:41:53 +02:00
curl -sS $URL | tar xz -C /tmp --strip 1
if [ -n "$GCC" ]; then
export CC="gcc-$GCC"
export CXX="g++-$GCC"
fi
if [ -n "$CLANG" ]; then
export CC="clang-$CLANG"
export CXX="clang++-$CLANG"
fi
if [ -n "$SANITIZE" ]; then
export CXXFLAGS="-fsanitize=$SANITIZE"
2019-02-27 17:41:40 +01:00
BUILD_TYPE="Debug"
else
BUILD_TYPE="Release"
fi
2019-02-27 17:41:40 +01:00
$CMAKE -DCMAKE_BUILD_TYPE=$BUILD_TYPE .
$CMAKE --build .
2017-04-22 11:34:12 +02:00
$CTEST --output-on-failure .