| 52 | return builtin.CompileAction |
| 53 | |
| 54 | def run(self, project, name, prop_set, sources): |
| 55 | if not name: |
| 56 | # Unless this generator is invoked as the top-most generator for a |
| 57 | # main target, fail. This allows using 'H' type as input type for |
| 58 | # this generator, while preventing Boost.Build to try this generator |
| 59 | # when not explicitly asked for. |
| 60 | # |
| 61 | # One bad example is msvc, where pch generator produces both PCH |
| 62 | # target and OBJ target, so if there's any header generated (like by |
| 63 | # bison, or by msidl), we'd try to use pch generator to get OBJ from |
| 64 | # that H, which is completely wrong. By restricting this generator |
| 65 | # only to pch main target, such problem is solved. |
| 66 | pass |
| 67 | else: |
| 68 | r = self.run_pch(project, name, |
| 69 | prop_set.add_raw(['<define>BOOST_BUILD_PCH_ENABLED']), |
| 70 | sources) |
| 71 | return generators.add_usage_requirements( |
| 72 | r, ['<define>BOOST_BUILD_PCH_ENABLED']) |
| 73 | |
| 74 | # This rule must be overridden by the derived classes. |
| 75 | def run_pch(self, project, name, prop_set, sources): |