summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-06 02:54:07 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-06 02:54:07 +0200
commitb9b4bad7ffea2bd309937f7a28697372ee0fedae (patch)
tree9392d07aaae88cb6eec5339c6618e71b71c4238a
parentb1462e1a08f39b6f434ca20330d1e48af03f2e97 (diff)
downloadkit-b9b4bad7ffea2bd309937f7a28697372ee0fedae.zip
test
-rw-r--r--build_and_test.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index 03c06fc..65d5466 100644
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -24,7 +24,7 @@ elif [ "$2" = "msvc" ]; then
OBJ_POSTFIX=.obj
FLAG_OBJ="-c -Fo"
FLAG_EXE="-Fe"
- LINK_FLAGS="Shlwapi.lib"
+ LINK_FLAGS="shlwapi.lib"
elif [ "$2" != "" ]; then
echo "Unknown C compiler"
exit 1
@@ -66,19 +66,21 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
OBJ_POSTFIX=.obj
FLAG_OBJ="-c -Fo"
FLAG_EXE="-Fe"
- LINK_FLAGS="Shlwapi.lib"
elif command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
- LINK_FLAGS="-lShlwapi.lib"
elif command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
COMPILEPP=clang++
- LINK_FLAGS="-lShlwapi.lib"
else
echo "C compiler not found"
exit 1
fi
+ if [ "$COMPILER" = "cl.exe" ]; then
+ LINK_FLAGS="shlwapi.lib"
+ else
+ LINK_FLAGS="-lshlwapi.lib"
+ fi
fi
;;
*)
@@ -135,8 +137,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/kit_test_suite${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- ${LINK_FLAGS} \
- "source/tests/_static.c"
+ "source/tests/_static.c" \
+ ${LINK_FLAGS}
if [ $? -ne 0 ]; then
exit 1
fi
@@ -145,8 +147,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/test_too_many_assertions${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- ${LINK_FLAGS} \
- "source/tests/test_too_many_assertions.c"
+ "source/tests/test_too_many_assertions.c" \
+ ${LINK_FLAGS}
if [ $? -ne 0 ]; then
exit 1
fi
@@ -155,8 +157,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/test_too_many_tests${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- ${LINK_FLAGS} \
- "source/tests/test_too_many_tests.c"
+ "source/tests/test_too_many_tests.c" \
+ ${LINK_FLAGS}
if [ $? -ne 0 ]; then
exit 1
fi
@@ -165,8 +167,8 @@ $COMPILEPP ${FLAGS} \
${FLAG_EXE}"build/test_cpp${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- ${LINK_FLAGS} \
- "source/tests/test_cpp.cpp"
+ "source/tests/test_cpp.cpp" \
+ ${LINK_FLAGS}
if [ $? -ne 0 ]; then
exit 1
fi
@@ -175,8 +177,8 @@ $COMPILEPP ${FLAGS} \
${FLAG_EXE}"build/test_signals${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- ${LINK_FLAGS} \
- "source/tests/test_signals.cpp"
+ "source/tests/test_signals.cpp" \
+ ${LINK_FLAGS}
if [ $? -ne 0 ]; then
exit 1
fi