Objective C/C++ works with XCode.

pull/15/head
Jussi Pakkanen 11 years ago
parent be627e479f
commit 4fa221bc49
  1. 14
      environment.py
  2. 2
      xcodebackend.py

@ -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) + '"')

@ -28,6 +28,8 @@ class XCodeBackend(backends.Backend):
'cxx' : 'sourcecode.cpp.cpp',
'cpp' : 'sourcecode.cpp.cpp',
'c++' : 'sourcecode.cpp.cpp',
'm' : 'sourcecode.c.objc',
'mm' : 'sourcecode.cpp.objcpp',
'h' : 'sourcecode.c.h',
'hpp' : 'sourcecode.cpp.h',
'hxx' : 'sourcecode.cpp.h',

Loading…
Cancel
Save