-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (38 loc) · 826 Bytes
/
build.sh
File metadata and controls
executable file
·43 lines (38 loc) · 826 Bytes
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
#!/bin/bash
# Available options
CC=clang
CXX=clang++
BUILDTESTS=OFF
# Get all options
for i in "$@"
do
case $i in
--cc=*)
CC="${i#*=}"
shift # past argument=value
;;
--cxx=*)
CXX="${i#*=}"
shift # past argument=value
;;
--build-tests)
BUILDTESTS=ON
shift # past argument with no value
;;
*)
# unknown option
;;
esac
done
echo "CC COMPILER = ${CC}"
echo "CXX COMPILER = ${CXX}"
echo "BUILD TESTS = ${BUILDTESTS}"
# The directory location of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Make the build directory
mkdir -p $DIR/build
cd $DIR/build
# Build with the specified options
cmake -DBUILD_TESTS=$BUILDTESTS -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX ..
CORES=`grep -c ^processor /proc/cpuinfo`
make -j$CORES