1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- """
- Map a compilation failure to a successs status. People playing with C++ templates
- might need this.
- """
- top = '.'
- out = 'build'
- def options(opt):
- opt.load('compiler_cxx')
- def configure(conf):
- conf.load('compiler_cxx')
- def build(bld):
- bld.objects(source='success.cpp', target='ok')
- bld.objects(source='fail.cpp', target='fail', features='fail')
- from waflib.Tools.cxx import cxx
- class cxxfail(cxx):
- def run(self):
- ret = super(cxxfail, self).run()
- self.outputs[0].write('just a simulation')
- return not ret
- def one_more_mapping(self, node):
- return self.create_compiled_task('cxxfail', node)
- from waflib.TaskGen import feature, before
- @before('process_source')
- @feature('fail')
- def remap_failure_to_success(self):
-
- self.mappings = dict(self.mappings)
-
- self.mappings['.cpp'] = one_more_mapping
|