summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_and_test.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index a7d7ff6..c624c68 100644
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -9,7 +9,33 @@ EXE_POSTFIX=
UNAME=$(uname)
-echo "UNAME: ${UNAME}"
+case $( "${UNAME}" | tr '[:upper:]' '[:lower:]') in
+ *darwin*)
+ if command -v clang >/dev/null 2>&1; then
+ echo "C compiler found - Clang"
+ COMPILE=clang
+ COMPILEPP=clang
+ elif command -v gcc >/dev/null 2>&1; then
+ echo "C compiler found - GCC"
+ fi
+ ;;
+ *msys*|*cygwin*|*mingw*|*nt*|*win*)
+ echo "C compiler found - MSVC"
+ COMPILE=cl.exe
+ COMPILEPP=cl.exe
+ OBJ_POSTFIX=.obj
+ EXE_POSTFIX=.exe
+ ;;
+ *)
+ if command -v gcc >/dev/null 2>&1; then
+ echo "C compiler found - GCC"
+ elif command -v clang >/dev/null 2>&1; then
+ echo "C compiler found - Clang"
+ COMPILE=clang
+ COMPILEPP=clang
+ fi
+ ;;
+esac
if command -v cl.exe >/dev/null 2>&1; then
echo "C compiler found - MSVC"