summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-07-19 12:07:59 +0200
committerPatrick Steinhardt <ps@pks.im>2019-07-20 19:10:10 +0200
commit1be4f896bd8c33e0acb8bcf5eda1f6d844c81c14 (patch)
tree9125abb3def5d90d2ef111d8a924b042cce13941
parent8e356f48f86495fb9efd76d422e22a4853f2bf67 (diff)
downloadlibgit2-1be4f896bd8c33e0acb8bcf5eda1f6d844c81c14.tar.gz
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.
-rwxr-xr-xazure-pipelines/build.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/azure-pipelines/build.sh b/azure-pipelines/build.sh
index ac4d37b77..6700d7bdb 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 "##############################################################################"