|
@@ -45,9 +45,13 @@ stats=false
|
|
|
|
|
|
export CMAKE_EXPORT_COMPILE_COMMANDS=true
|
|
|
|
|
|
+cleanFolders() {
|
|
|
+ rm -rf build_debug build_profile build_release install
|
|
|
+}
|
|
|
+
|
|
|
# parsing
|
|
|
if [ "$task" = "clean" ]; then
|
|
|
- rm -rf build_debug build_profile build_release install
|
|
|
+ cleanFolders
|
|
|
elif [ "$task" = "build" ]; then
|
|
|
type=$2
|
|
|
if [ "$type" = "debug" ]; then
|
|
@@ -125,6 +129,11 @@ fi
|
|
|
buildProfile() {
|
|
|
folder=$1
|
|
|
shift 1
|
|
|
+ if [ -e "$folder" ]; then
|
|
|
+ if ! cat $folder/CMakeCache.txt | grep "CMAKE_C_COMPILER:" | grep $compiler > /dev/null; then
|
|
|
+ cleanFolders
|
|
|
+ fi
|
|
|
+ fi
|
|
|
if [ ! -e "$folder" ]; then
|
|
|
cmake -B "$folder" -S . -G Ninja -DCMAKE_C_COMPILER="${compiler}" -DCMAKE_INSTALL_PREFIX=../install "$@"
|
|
|
fi
|