Added a build script

Use -r to run the program after building and use -c to clear the build
folder after running (just after building if u dont use -r)
This commit is contained in:
2026-01-14 19:59:44 -08:00
parent e63912fac5
commit 7b31b2a1b1

34
debug-build.sh Executable file
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/CrabCrawler
fi
if $CLEAR_BUILD; then
echo "Clearing build folder..."
rm -rf build
fi