File: build.sh

package info (click to toggle)
apt-cacher-ng 3.3.1-2~bpo10+1
  • links: PTS, VCS
  • area: main
  • in suites: buster-backports
  • size: 2,040 kB
  • sloc: cpp: 17,564; sh: 553; ansic: 401; perl: 377; makefile: 126
file content (31 lines) | stat: -rwxr-xr-x 718 bytes parent folder | download | duplicates (9)
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
#!/bin/sh
mkdir -p builddir
src=$PWD
# honor user environments if set, otherwise use Release defaults
test -n "$CXXFLAGS" || CMAKEFLAGS=-DCMAKE_BUILD_TYPE=Release

# dev shortcuts
while : ; do
   case "$1" in
      DEBUG)
         shift
         CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON --debug-trycompile --debug-output"
         ;;
      VERBOSE)
         shift
         CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_VERBOSE_MAKEFILE=ON"
         ;;
      *)
         break 2;
         ;;
   esac
done

cd builddir
if ! cmake $src $CMAKEFLAGS "$@"
then
	echo Configuration failed, please fix the reported issues and run ./distclean.sh
	exit 1
fi
PAR=-j$(nproc 2>/dev/null) || PAR=-j3
make $PAR