diff --git a/glfw/glfw.py b/glfw/glfw.py index 336fb2a40..8605ec65d 100755 --- a/glfw/glfw.py +++ b/glfw/glfw.py @@ -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) diff --git a/setup.py b/setup.py index a005cff8c..e26e2f4a9 100755 --- a/setup.py +++ b/setup.py @@ -701,11 +701,11 @@ def get_source_specific_cflags(env: Env, src: str) -> List[str]: ans.append('-msse4.2' if '128' in src else '-mavx2') if '256' in src: # We have manual vzeroupper so prevent compiler from emitting it causing duplicates - if env.is_gcc: - ans.append('-mno-vzeroupper') - else: + if env.is_clang: ans.append('-mllvm') ans.append('-x86-use-vzeroupper=0') + else: + ans.append('-mno-vzeroupper') elif env.binary_arch.isa != ISA.ARM64: ans.append('-DKITTY_NO_SIMD') elif src.startswith('3rdparty/base64/lib/arch/'): @@ -1170,7 +1170,7 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's sanitize_args = get_sanitize_args(env.cc, env.ccver) cflags.extend(sanitize_args) ldflags.extend(sanitize_args) - libs += ['-lasan'] if not is_macos and env.is_gcc else [] + libs += ['-lasan'] if not is_macos and not env.is_clang else [] else: cflags.append('-g') if args.profile: