ci-mac.sh 1.24 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5 6 7
#!/bin/bash

#Exit on any error
set -e

LANGUAGE=$1

8 9 10 11
echo "============================="
echo "Build information"
echo "============================="

Jan Möbius's avatar
Jan Möbius committed
12 13 14 15 16 17 18 19 20 21 22 23
PATH=$PATH:/opt/local/bin
export PATH

OPTIONS=""

if [ "$LANGUAGE" == "C++98" ]; then
  echo "Building with C++98";
elif [ "$LANGUAGE" == "C++11" ]; then
  echo "Building with C++11";
  OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
fi

24 25 26 27 28 29 30 31 32 33
echo "============================="
echo "Software Directory content:  "
echo "============================="

ls ~/sw

echo "============================="
echo "Starting Build: "
echo "============================="

Jan Möbius's avatar
Jan Möbius committed
34 35 36 37
#########################################
# Base Submodule init
git submodule init
git submodule update
38

Jan Möbius's avatar
Jan Möbius committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

#########################################
# Build release version
#########################################

if [ ! -d build-release ]; then
  mkdir build-release
fi

cd build-release

cmake -DCMAKE_BUILD_TYPE=Release -DSTL_VECTOR_CHECKS=ON $OPTIONS ../

#build it
make

cd ..


#########################################
# Build Debug version and Unittests
#########################################

if [ ! -d build-debug ]; then
  mkdir build-debug
fi

cd build-debug

cmake -DCMAKE_BUILD_TYPE=Debug -DSTL_VECTOR_CHECKS=ON $OPTIONS ../

#build it
make