-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·25 lines (20 loc) · 884 Bytes
/
build.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
BUILD_TYPE=$1
if [ $# -eq 0 ] || [ -z "$1" ]
then
echo "Expected Release or Debug as argument"
exit 1
fi
if [ $BUILD_TYPE != 'Release' ] && [ $BUILD_TYPE != 'Debug' ]
then
echo "Expected Release or Debug as argument"
exit 1
fi
C_COMPILER="/usr/bin/clang"
CXX_COMPILER="/usr/bin/clang++"
FLAGS="-Werror -Wall -Wextra -Wc++17-extensions"
cmake -G Ninja -D CMAKE_C_COMPILER=$C_COMPILER -D CMAKE_CXX_COMPILER=$CXX_COMPILER -D CMAKE_CXX_FLAGS_INIT=$FLAGS -D CMAKE_BUILD_TYPE=$BUILD_TYPE -S ./RoMoController -B ./build
cmake --build ./build --config $BUILD_TYPE --target all --
echo 'Adding the default samples to the executable directory..'
sudo cp ~/Mobots-3dPrinter/Samples/hello-world.ngc ~/Mobots-3dPrinter/build/
sudo mv ~/Mobots-3dPrinter/build/hello-world.ngc ~/Mobots-3dPrinter/build/gcode.ngc
sudo cp ~/Mobots-3dPrinter/Samples/config.ini ~/Mobots-3dPrinter/build/