]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix Apple Clang detection
authorGregor Jasny <gregor.jasny@logmein.com>
Tue, 29 Jun 2021 09:42:50 +0000 (11:42 +0200)
committerGregor Jasny <gregor.jasny@logmein.com>
Tue, 29 Jun 2021 09:48:46 +0000 (11:48 +0200)
Apple Clang, when called via `gcc` emits a `Configured with` line
on stderr which confuses the compiler detection. We just ignore
stderr for the `--version` query now.

test/run
test/suites/direct_gcc.bash

index 57c7dd8d5b91305da4e2aa52a2ac73eead50a667..bf4155b2f83b385f198e2c55660a49cc91fa3a5b 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -470,7 +470,7 @@ HOST_OS_FREEBSD=false
 HOST_OS_WINDOWS=false
 HOST_OS_CYGWIN=false
 
-compiler_version="`$COMPILER --version 2>&1 | head -1`"
+compiler_version="`$COMPILER --version 2>/dev/null | head -1`"
 case $compiler_version in
     *gcc*|*g++*|2.95*)
         COMPILER_TYPE_GCC=true
@@ -571,7 +571,7 @@ if [ "$REAL_COMPILER" = "$COMPILER" ]; then
 else
     echo "Compiler:         $COMPILER ($REAL_COMPILER)"
 fi
-echo "Compiler version: $($COMPILER --version | head -n 1)"
+echo "Compiler version: $($COMPILER --version 2>/dev/null | head -n 1)"
 
 REAL_NVCC=$(find_compiler nvcc)
 REAL_CUOBJDUMP=$(find_compiler cuobjdump)
index 57b6ed9fdbfc3cd4911d4a331ceaf32cdde28c72..73b045b35beb99b31aac56b94e3c705404f08914 100644 (file)
@@ -1,5 +1,5 @@
 SUITE_direct_gcc_PROBE() {
-    if [[ $REAL_COMPILER != *"gcc"* ]]; then
+    if [[ "${COMPILER_TYPE_GCC}" != "true" ]]; then
         echo "Skipping GCC only test cases"
     fi
 }