summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_and_test.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index c61a04f..e086f65 100644
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -7,6 +7,8 @@ COMPILEPP=g++
OBJ_POSTFIX=.o
EXE_POSTFIX=
FLAGS=
+FLAG_OBJ="-c -o"
+FLAG_EXE="-o"
case $(uname | tr '[:upper:]' '[:lower:]') in
*darwin*)
@@ -30,6 +32,8 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
COMPILEPP=cl.exe
OBJ_POSTFIX=.obj
EXE_POSTFIX=.exe
+ FLAG_OBJ="/c /Fo"
+ FLAG_EXE="/Fe"
elif command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
elif command -v clang >/dev/null 2>&1; then
@@ -67,27 +71,27 @@ if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "clang" ]; then
fi
else
if [ "$1" = "release" ]; then
- FLAGS="\O2"
+ FLAGS="/O2"
else
- FLAGS="\Od"
+ FLAGS="/Od"
fi
fi
-$COMPILE -c -o "build/kit${OBJ_POSTFIX}" \
+$COMPILE ${FLAG_OBJ} "build/kit${OBJ_POSTFIX}" \
${FLAGS} \
"source/kit/_static.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILE -c -o "build/kit_test${OBJ_POSTFIX}" \
+$COMPILE ${FLAG_OBJ} "build/kit_test${OBJ_POSTFIX}" \
${FLAGS} \
"source/kit_test/_static.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILE -o "build/kit_test_suite${EXE_POSTFIX}" \
+$COMPILE ${FLAG_EXE} "build/kit_test_suite${EXE_POSTFIX}" \
${FLAGS} \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
@@ -96,7 +100,7 @@ if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILE -o "build/test_too_many_assertions${EXE_POSTFIX}" \
+$COMPILE ${FLAG_EXE} "build/test_too_many_assertions${EXE_POSTFIX}" \
${FLAGS} \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
@@ -105,7 +109,7 @@ if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILE -o "build/test_too_many_tests${EXE_POSTFIX}" \
+$COMPILE ${FLAG_EXE} "build/test_too_many_tests${EXE_POSTFIX}" \
${FLAGS} \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
@@ -114,7 +118,7 @@ if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILEPP -o "build/test_cpp${EXE_POSTFIX}" \
+$COMPILEPP ${FLAG_EXE} "build/test_cpp${EXE_POSTFIX}" \
${FLAGS} \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
@@ -123,7 +127,7 @@ if [ ! $? -eq 0 ]; then
exit 1
fi
-$COMPILEPP -o "build/test_signals${EXE_POSTFIX}" \
+$COMPILEPP ${FLAG_EXE} "build/test_signals${EXE_POSTFIX}" \
${FLAGS} \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \