Added build script

This commit is contained in:
Puppet committed 2026-03-11 20:36:10 -07:00
1 parent f5079f6713
commit 1f09e22b12
1 file changed
+34
Executable
+34
View File
@@ -0,0 +1,34 @@
# This has only been tested on Linux Mint
#!/bin/bash
CLEAR_BUILD=false
RUN_PROGRAM=false
# Checks flags
# Idk why case statements look so weird in bash but it works lol
# Use -r to run the program after building and use -c to clear the build folder after running
while getopts "cr" opt; do
case "$opt" in
c)
CLEAR_BUILD=true
;;
r)
RUN_PROGRAM=true
;;
esac
done
# Builds Crab Crawler
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build
cmake --build ./build
# Runs the program if the -r flag is provided
if $RUN_PROGRAM; then
echo "Running the Build..."
./build/TBCLI
fi
if $CLEAR_BUILD; then
echo "Clearing build folder..."
rm -rf build
fi