Commit 1be4f896bd8c33e0acb8bcf5eda1f6d844c81c14

Patrick Steinhardt 2019-07-19T12:07:59

azure: avoid executing compiler if there is none Until now, we always had the CC variable defined in the build.sh pipeline. But as we're about to migrate the Windows jobs to Bash, as well, those will not have CC defined and thus we cannot use "$CC" to determine the compiler version. Fix this by only executing "$CC" if the variable was set.

diff --git a/azure-pipelines/build.sh b/azure-pipelines/build.sh
index ac4d37b..6700d7b 100755
--- a/azure-pipelines/build.sh
+++ b/azure-pipelines/build.sh
@@ -10,7 +10,6 @@ set -e
 SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
 BUILD_DIR=$(pwd)
 BUILD_PATH=${BUILD_PATH:=$PATH}
-CC=${CC:-cc}
 CMAKE=$(which cmake)
 
 indent() { sed "s/^/    /"; }
@@ -34,8 +33,11 @@ uname -a 2>&1 | indent
 
 echo "CMake version:"
 env PATH="$BUILD_PATH" "$CMAKE" --version 2>&1 | indent
-echo "Compiler version:"
-$CC --version 2>&1 | indent
+
+if test -n "$CC"; then
+	echo "Compiler version:"
+	"$CC" --version 2>&1 | indent
+fi
 echo ""
 
 echo "##############################################################################"