summaryrefslogtreecommitdiffhomepage
path: root/coverity/build.sh
blob: 3d662f8b27df069b52e29813ebe0ac4cb2c9bd75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

cleanup() {
    for i in cov-build ninja; do
        taskkill -f -t -im "$i.exe" 2>/dev/null 1>&2
    done
    rm -f "$myfile"
}

signal() {
    set +e
    trap '' EXIT
    echo "error: $1" 1>&2
    cleanup
    exit 1
}

export PATH="/d/dev/cov-analysis-win64-8.7.0/bin:/c/msys64/mingw32/bin:/c/msys64/usr/bin:$PATH"

for k in HUP INT QUIT ILL BUS FPE SEGV PIPE; do
    trap "signal 'got fatal signal SIG'$k" SIG"$k"
done

trap 'signal "fatal return $?"' EXIT

set -e

mydate="$(date --iso-8601=minutes)"
mydir="$(dirname -- "$0")"
myfile="opentrack-"$mydate".7z"

cd "$mydir"
for k in opencv aruco libovr-025  libovr-042 libovr-080; do
    ninja -C "./$k"
done

cd "./opentrack"

cmake .
ninja32 clean
cov-build --dir cov-int ninja
rm -f "../$myfile" || true
7za -mx a "../$myfile" cov-int
trap '' EXIT
exit 0