| 32 | from b2.util import bjam_signature |
| 33 | |
| 34 | class CastTargetClass(targets.TypedTarget): |
| 35 | |
| 36 | def construct(name, source_targets, ps): |
| 37 | result = [] |
| 38 | for s in source_targets: |
| 39 | if not isinstance(s, virtual_targets.FileTarget): |
| 40 | get_manager().errors()("Source to the 'cast' metatager is not a file") |
| 41 | |
| 42 | if s.action(): |
| 43 | get_manager().errors()("Only non-derived targets allowed as sources for 'cast'.") |
| 44 | |
| 45 | |
| 46 | r = s.clone_with_different_type(self.type()) |
| 47 | result.append(get_manager().virtual_targets().register(r)) |
| 48 | |
| 49 | return result |
| 50 | |
| 51 | |
| 52 | @bjam_signature((["name", "type"], ["sources", "*"], ["requirements", "*"], |