Simplify build order settings for "subst" tasks

This commit is contained in:
Thomas Nagy 2017-06-15 20:36:30 +02:00
parent af4a768775
commit 0b5202a88b
1 changed files with 4 additions and 8 deletions

View File

@ -865,21 +865,17 @@ def process_subst(self):
if not a:
raise Errors.WafError('could not find %r for %r' % (x, self))
has_constraints = False
tsk = self.create_task('subst', a, b)
for k in ('after', 'before', 'ext_in', 'ext_out'):
val = getattr(self, k, None)
if val:
has_constraints = True
setattr(tsk, k, val)
# paranoid safety measure for the general case foo.in->foo.h with ambiguous dependencies
if not has_constraints:
global HEADER_EXTS
for xt in HEADER_EXTS:
if b.name.endswith(xt):
tsk.before = [k for k in ('c', 'cxx') if k in Task.classes]
break
for xt in HEADER_EXTS:
if b.name.endswith(xt):
tsk.ext_in = tsk.ext_in + ['.h']
break
inst_to = getattr(self, 'install_path', None)
if inst_to: