Thread (17 messages) 17 messages, 4 authors, 2021-08-09

Re: [PATCH] makefile: update detect-compiler for newer Xcode version

From: Junio C Hamano <hidden>
Date: 2021-08-06 18:11:35

Possibly related (same subject, not in this thread)

Atharva Raykar [off-list ref] writes:
Carlo Marcelo Arenas Belón [off-list ref] writes:

For those of us using Homebrew and using the LLVM installation from
there, we get:

$ cc --version
Homebrew clang version 12.0.1
...
quoted
diff --git a/detect-compiler b/detect-compiler
index 70b754481c..c85be83c64 100755
--- a/detect-compiler
+++ b/detect-compiler
@@ -44,7 +44,7 @@ clang)
 "FreeBSD clang")
 	print_flags clang
 	;;
-"Apple LLVM")
+"Apple LLVM"|"Apple clang")
 	print_flags clang
 	;;
 *)
So maybe we could add another case for "Homebrew clang"?
$ clang --version 2>&1 | sed -ne 's/ version .*//p'
Debian clang

It might be necessary to cope with this "$VENDOR clang version"
convention better with something like the following.

I am afraid that this patch is being a bit too aggressive about
LLVM, as I do not know if "$VENDOR LLVM version" is also a thing, or
it is just oddity only at Apple, though.
diff --git c/detect-compiler w/detect-compiler
index 70b754481c..a80442a327 100755
--- c/detect-compiler
+++ w/detect-compiler
@@ -38,13 +38,7 @@ case "$(get_family)" in
 gcc)
 	print_flags gcc
 	;;
-clang)
-	print_flags clang
-	;;
-"FreeBSD clang")
-	print_flags clang
-	;;
-"Apple LLVM")
+clang | *" clang" | *" LLVM")
 	print_flags clang
 	;;
 *)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help