-
Notifications
You must be signed in to change notification settings - Fork 16
/
scripts.sh
executable file
·41 lines (36 loc) · 1014 Bytes
/
scripts.sh
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
#!/bin/bash
# Usefull scripts to use while developing slope
if [[ $EUID -eq 0 ]]; then
echo 'It is not recommened to run these commands as root'
exit -1
fi
if [[ $# -eq 0 ]]; then
echo 'You have to provide a command to run'
exit -1
fi
# clang-format adjusts source code format (braces placement, indentation, etc)
if [[ $1 == 'clang-format' ]]; then
find . -iname *.h -o -iname *.c | xargs clang-format-3.9 -i
fi
# builds slope in debug mode
if [[ $1 == 'build-debug' ]]; then
if [[ -d build/Debug ]]; then
# Yes this may increase your compile times
rm -rf build/Debug
fi
mkdir -p build/Debug
cd build/Debug
cmake -DCMAKE_BUILD_TYPE=Debug ../../
make
fi
# builds slope in release mode
if [[ $1 == 'build-release' ]]; then
if [[ -d build/Release ]]; then
# Yes this may increase your compile times
rm -rf build/Release
fi
mkdir -p build/Release
cd build/Release
cmake -DCMAKE_BUILD_TYPE=Release ../../
make
fi