Skip to content

Commit 1be4f89

Browse files
committed
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.
1 parent 8e356f4 commit 1be4f89

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

azure-pipelines/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set -e
1010
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
1111
BUILD_DIR=$(pwd)
1212
BUILD_PATH=${BUILD_PATH:=$PATH}
13-
CC=${CC:-cc}
1413
CMAKE=$(which cmake)
1514

1615
indent() { sed "s/^/ /"; }
@@ -34,8 +33,11 @@ uname -a 2>&1 | indent
3433

3534
echo "CMake version:"
3635
env PATH="$BUILD_PATH" "$CMAKE" --version 2>&1 | indent
37-
echo "Compiler version:"
38-
$CC --version 2>&1 | indent
36+
37+
if test -n "$CC"; then
38+
echo "Compiler version:"
39+
"$CC" --version 2>&1 | indent
40+
fi
3941
echo ""
4042

4143
echo "##############################################################################"

0 commit comments

Comments
 (0)