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