Fix #6880: [OSX] Clang version detection

This commit is contained in:
Charles Pigott 2018-09-24 22:18:58 +01:00 committed by Patric Stout
parent 0e7af55ef7
commit 175829b8b5
1 changed files with 2 additions and 1 deletions

View File

@ -1331,7 +1331,8 @@ make_compiler_cflags() {
fi
elif echo "$version_line" | grep -q "clang"; then
# Enable some things only for certain clang versions
cc_version="`$1 -v 2>&1 | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"
# Need to try really hard to get the version line, because OSX clang likes to hide its true version
cc_version="`$1 -v 2>&1 | grep -i version | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"
# aliasing rules are not held in openttd code
flags="$flags -fno-strict-aliasing"