Import backtrace-cpp and integrate it into our main executable

Upstream release
https://github.com/bombela/backward-cpp/archive/v1.3.tar.gz
This commit is contained in:
Simon Fels 2018-05-18 17:46:38 +02:00
commit e6a0821cfc
25 changed files with 3606 additions and 1 deletions

77
external/backtrace-cpp/builds.sh vendored Executable file
View file

@ -0,0 +1,77 @@
#!/bin/bash
COMPILERS_CXX98=`cat<<EOF
gcc-4.4
gcc-4.6
gcc-4.7
gcc-4.8
clang
EOF`
COMPILERS_CXX11=`cat<<EOF
gcc-4.7
gcc-4.8
clang
EOF`
function mkbuild() {
local compiler=$1
local lang=$2
local buildtype=$3
local builddir="$4"
export CC=$compiler
export CXX=`echo $compiler | sed -e 's/clang/clang++/' -e 's/gcc/g++/'`
export CXXFLAGS="-std=$lang"
echo "Creating $builddir"
mkdir $builddir 2>/dev/null
(
cd "$builddir"
cmake -DCMAKE_BUILD_TYPE=$buildtype ..
)
}
function build() {
local builddir=$1
shift
make -C "$builddir" $@
}
function dotest() {
local builddir=$1
shift
make -C "$builddir" test $@
return 0
}
function do_action() {
local lang=$1
local action=$2
shift 2
for compiler in $COMPILERS; do
local builddir="build_${lang}_${compiler}"
if [[ $action == "cmake" ]]; then
buildtype=$1
mkbuild $compiler $lang "$buildtype" "$builddir"
[[ $? != 0 ]] && exit
elif [[ $action == "make" ]]; then
build "$builddir" $@
[[ $? != 0 ]] && exit
elif [[ $action == "test" ]]; then
dotest "$builddir" $@
[[ $? != 0 ]] && exit
elif [[ $action == "clean" ]]; then
rm -r "$builddir"
else
echo "usage: $0 cmake [debug|release|relwithdbg]|make|test|clean"
exit 255
fi
done
}
COMPILERS=$COMPILERS_CXX98
do_action c++98 $@
COMPILERS=$COMPILERS_CXX11
do_action c++11 $@