From 062c5cae1afaf3032652d3140aa2e34e4f09b132 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sun, 8 Apr 2012 21:24:42 +0200 Subject: [PATCH] add default constraints on the case subst:foo.in->foo.h for convenience purposes --- waflib/TaskGen.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/waflib/TaskGen.py b/waflib/TaskGen.py index 6d6313d6..00b67d30 100644 --- a/waflib/TaskGen.py +++ b/waflib/TaskGen.py @@ -786,12 +786,18 @@ def process_subst(self): if not a: raise Errors.WafError('cound 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 and b.name.endswith('.h'): + tsk.before = [k for k in ('c', 'cxx') if k in Task.classes] + inst_to = getattr(self, 'install_path', None) if inst_to: self.bld.install_files(inst_to, tgt, chmod=getattr(self, 'chmod', Utils.O644))