ci-linux-build.sh 1.35 KB
Newer Older
1 2 3 4 5 6 7 8
#!/bin/bash

# Script abort on error
set -e

# Expected Settings via environment variables:
# COMPILER= gcc/clang
# LANGUAGE= C++98 / C++11
Jan Möbius's avatar
Jan Möbius committed
9
# QTVERSION= QT5
10
# BUILDTYPE= Debug / Release
11 12 13 14


#include ci options script
MY_DIR=$(dirname $(readlink -f $0))
15
source $MY_DIR/ci-linux-config.sh
16

17
echo "Building with path: $BUILDPATH"
18 19 20 21 22 23 24 25 26 27 28 29 30 31
echo "Full cmake options: $OPTIONS  "

########################################
# Fetch test data
########################################
rm -rf TestData
git clone git@roosevelt:moebius/OpenFlipper-Test-Data.git TestData


#########################################
# Build Release version and Unittests
#########################################

# Make release build folder
32 33
if [ ! -d $BUILDPATH ]; then
  mkdir $BUILDPATH
34 35
fi

36
cd $BUILDPATH
37

38
cmake -DOPENFLIPPER_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
39 40 41 42 43 44

#build it
make $MAKE_OPTIONS

# copy the used shared libraries to the lib folder
cd Build
45 46 47 48 49

if [ ! -d systemlib ]; then
  mkdir systemlib
fi

50
ldd bin/OpenFlipper | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' systemlib
51 52 53 54 55 56 57 58 59 60 61
cd ../..

#create an artifact directory
if [ ! -d artifacts ]; then
  mkdir artifacts
fi

#cp -R * artifacts
rsync -a --exclude=artifacts --exclude=.git . ./artifacts
cd artifacts
#rm -rf .git
62 63 64

# create an archive with all the build files so we can use them in the test script
#tar -cvf ../buildfiles.tar .