Supporters update.
[dcpomatic.git] / run / dcpomatic
1 #!/bin/bash
2
3 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 source $DIR/environment
5 binary=$build/src/tools/dcpomatic2
6
7 if [[ "$(uname -m)" == arm64 ]]; then
8     env=arm64/11.0
9 else
10     env=x86_64/10.10
11 fi
12
13 export DYLD_LIBRARY_PATH=/Users/cah/osx-environment/$env/lib:/usr/local/lib
14
15 # export ASAN_OPTIONS=verbosity=1:malloc_context_size=20:detect_leaks=1
16
17 if [ "$1" == "--debug" ]; then
18     shift
19     if [[ "$(uname)" == Darwin ]]; then
20         /Applications/Xcode.app/Contents/Developer/usr/bin/lldb $binary $*
21     else
22         gdb --args $binary $*
23     fi
24 elif [ "$1" == "--valgrind" ]; then
25     shift
26     valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full $binary $*
27 elif [ "$1" == "--callgrind" ]; then
28     shift
29     valgrind --tool="callgrind" $binary $*
30 elif [ "$1" == "--massif" ]; then
31     shift
32     valgrind --tool="massif" $binary $*
33 elif [ "$1" == "--i18n" ]; then
34     shift
35     LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 $binary "$*"
36 elif [ "$1" == "--perf" ]; then
37     shift
38     perf record $binary $*
39 elif [ "$1" == "--scaled" ]; then
40     shift
41     ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 $binary $*
42 elif [ "$1" == "--screenshot" ]; then
43     shift
44     GTK_PATH=/usr/local/lib/gtk-3.0 GTK_MODULES=gtk-vector-screenshot $binary "$*"
45 else
46     $binary $* 2> >(grep -v Gtk-CRITICAL | grep -v Gtk-WARNING)
47 fi