| 535 | ################################################################################ |
| 536 | |
| 537 | class MsvcPchGenerator(pch.PchGenerator): |
| 538 | |
| 539 | # Inherit the __init__ method |
| 540 | |
| 541 | def run_pch(self, project, name, prop_set, sources): |
| 542 | # Find the header in sources. Ignore any CPP sources. |
| 543 | pch_header = None |
| 544 | pch_source = None |
| 545 | for s in sources: |
| 546 | if type.is_derived(s.type(), 'H'): |
| 547 | pch_header = s |
| 548 | elif type.is_derived(s.type(), 'CPP') or type.is_derived(s.type(), 'C'): |
| 549 | pch_source = s |
| 550 | |
| 551 | if not pch-header: |
| 552 | raise RuntimeError( "can not build pch without pch-header" ) |
| 553 | |
| 554 | # If we do not have the PCH source - that is fine. We will just create a |
| 555 | # temporary .cpp file in the action. |
| 556 | temp_prop_set = property_set.create([Property('pch-source',pch_source)]+prop_set.all()) |
| 557 | generated = Generator.run(project,name,temp_prop_set,pch_header) |
| 558 | pch_file = None |
| 559 | for g in generated: |
| 560 | if type.is_derived(g.type(), 'PCH'): |
| 561 | pch_file = g |
| 562 | return property_set.create([Property('pch-header',pch_header),Property('pch-file',pch_file)]+generated) |
| 563 | |
| 564 | |
| 565 | ################################################################################ |
no outgoing calls
no test coverage detected