Enable gccdeps for clang too

This commit is contained in:
Thomas Nagy 2015-02-20 14:43:55 +01:00
parent bbf26e0e12
commit e8ae9c1a59
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 4 additions and 3 deletions

View File

@ -17,23 +17,24 @@ lock = threading.Lock()
preprocessor_flag = '-MD'
# Third-party tools are allowed to add extra names in here with append()
supported_compilers = ['gcc', 'icc']
supported_compilers = ['gcc', 'icc', 'clang']
@feature('c')
@before_method('process_source')
def add_mmd_cc(self):
if self.env.CC_NAME in supported_compilers and self.env.get_flat('CFLAGS').find(preprocessor_flag) < 0:
self.env.append_value('CFLAGS', [preprocessor_flag])
self.env.HAS_GCCDEPS = 1
@feature('cxx')
@before_method('process_source')
def add_mmd_cxx(self):
if self.env.CXX_NAME in supported_compilers and self.env.get_flat('CXXFLAGS').find(preprocessor_flag) < 0:
self.env.append_value('CXXFLAGS', [preprocessor_flag])
self.env.HAS_GCCDEPS = 1
def scan(self):
"the scanner does not do anything initially"
if self.env.CC_NAME not in supported_compilers:
if not self.env.HAS_GCCDEPS:
return self.no_gccdeps_scan()
nodes = self.generator.bld.node_deps.get(self.uid(), [])
names = []