|
|
|
@ -725,6 +725,16 @@ class GnuObjCPPCompiler(ObjCPPCompiler): |
|
|
|
|
def get_soname_flags(self, shlib_name, path): |
|
|
|
|
return get_gcc_soname_flags(self.gcc_type, shlib_name, path) |
|
|
|
|
|
|
|
|
|
class ClangObjCCompiler(GnuObjCCompiler): |
|
|
|
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None): |
|
|
|
|
super().__init__(exelist, version, is_cross, exe_wrapper) |
|
|
|
|
self.id = 'clang' |
|
|
|
|
|
|
|
|
|
class ClangObjCPPCompiler(GnuObjCPPCompiler): |
|
|
|
|
def __init__(self, exelist, version, is_cross, exe_wrapper=None): |
|
|
|
|
super().__init__(exelist, version, is_cross, exe_wrapper) |
|
|
|
|
self.id = 'clang' |
|
|
|
|
|
|
|
|
|
class ClangCCompiler(CCompiler): |
|
|
|
|
std_warn_flags = ['-Wall', '-Winvalid-pch'] |
|
|
|
|
std_opt_flags = ['-O2'] |
|
|
|
@ -1157,6 +1167,8 @@ class Environment(): |
|
|
|
|
if (out.startswith('cc ') or 'gcc' in out) and \ |
|
|
|
|
'Free Software Foundation' in out: |
|
|
|
|
return GnuObjCCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
if out.startswith('Apple LLVM'): |
|
|
|
|
return ClangObjCCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
if 'apple' in out and 'Free Software Foundation' in out: |
|
|
|
|
return GnuObjCCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') |
|
|
|
@ -1185,6 +1197,8 @@ class Environment(): |
|
|
|
|
if (out.startswith('c++ ') or out.startswith('g++')) and \ |
|
|
|
|
'Free Software Foundation' in out: |
|
|
|
|
return GnuObjCPPCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
if out.startswith('Apple LLVM'): |
|
|
|
|
return ClangObjCPPCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
if 'apple' in out and 'Free Software Foundation' in out: |
|
|
|
|
return GnuObjCPPCompiler(exelist, version, is_cross, exe_wrap) |
|
|
|
|
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') |
|
|
|
|