Switch to detecting clang rather than gcc

gcc makes it impossible to detect that it is gcc via --version
so instead detect clang and assume gcc if not clang.

Fixes #7218
This commit is contained in:
Kovid Goyal
2024-03-14 10:48:27 +05:30
parent 297ac9c3fe
commit 3950632517
2 changed files with 6 additions and 7 deletions

View File

@@ -46,7 +46,6 @@ class BinaryArch(NamedTuple):
isa: ISA = ISA.AMD64
class Env:
cc: List[str] = []
@@ -89,8 +88,8 @@ class Env:
return self._cc_version_string
@property
def is_gcc(self) -> bool:
return 'gcc' in self.cc_version_string.split(maxsplit=1)[0].lower()
def is_clang(self) -> bool:
return 'clang' in self.cc_version_string.split(maxsplit=1)[0].lower()
def copy(self) -> 'Env':
ans = Env(self.cc, list(self.cppflags), list(self.cflags), list(self.ldflags), dict(self.library_paths), list(self.ldpaths), self.ccver)