From b9b4bad7ffea2bd309937f7a28697372ee0fedae Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Wed, 6 Sep 2023 02:54:07 +0200 Subject: test --- build_and_test.sh | 30 ++++++++++++++++-------------- 1 file 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 -- cgit v1.2.3