msgpack/ci/build_cmake.sh
Takatoshi Kondo ef09252dff Added the Boost.Optional adaptor.
It is enables when MSGPACK_USE_BOOST is defined.
2015-04-09 14:46:06 +09:00

97 lines
1015 B
Bash
Executable File

#!/bin/bash
mkdir build
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
cd build
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
if [ $1 = "cpp11" ]
then
cpp11="-DMSGPACK_CXX11=ON"
else
cpp11=""
fi
if [ $2 = "32" ]
then
bit32="-DMSGPACK_32BIT=ON"
else
bit32=""
fi
if [ $3 = "boost" ]
then
boost="-DMSGPACK_BOOST=ON"
else
boost=""
fi
if [ "$4" != "" ]
then
boost_dir="-DMSGPACK_BOOST_DIR=$4"
else
boost_dir=""
fi
cmake $cpp11 $bit32 $boost $boost_dir ..
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
make
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
make test
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
make install DESTDIR=`pwd`/install
ret=$?
if [ $ret -ne 0 ]
then
exit $ret
fi
if [ "$2" != "32" ]
then
ctest -T memcheck | tee memcheck.log
ret=${PIPESTATUS[0]}
if [ $ret -ne 0 ]
then
exit $ret
fi
cat memcheck.log | grep "Memory Leak" > /dev/null
ret=$?
if [ $ret -eq 0 ]
then
exit 1
fi
fi
exit 0