fix crash when copy'ing latent plugins
[ardour.git] / libs / canvas / build-and-run-benchmark.sh
1 #!/bin/bash
2 #
3
4 if [ ! -f './canvas.cc' ]; then
5     echo "This script must be run from within the libs/canvas directory";
6     exit 1;
7 fi
8
9 debug=0
10 callgrind=0
11 valgrind=0
12 if [ "$1" == "--debug" ]; then
13     debug=1
14     name=$2
15 elif [ "$1" == "--callgrind" ]; then
16     callgrind=1
17     name=$2
18 elif [ "$1" == "--valgrind" ]; then
19     valgrind=1
20     name=$2
21 else
22     name=$1
23 fi
24
25 waft --targets libcanvas-benchmark-$name
26 if [ "$?" != 0 ]; then
27   exit
28 fi
29
30 srcdir=`pwd`
31 cd ../../build/default
32
33 libs='libs'
34
35 export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:$libs/canvas:$LD_LIBRARY_PATH
36
37 if [ "$debug" == "1" ]; then
38     gdb ./libs/canvas/benchmark/$name $3 $4
39 elif [ "$callgrind" == "1" ]; then
40     valgrind --tool="callgrind" ./libs/canvas/benchmark/$name $3 $4
41 elif [ "$valgrind" == "1" ]; then
42     valgrind --tool="memcheck" ./libs/canvas/benchmark/$name $3 $4
43 else
44     ./libs/canvas/benchmark/$name $2 $3
45 fi
46
47