Skip to content

Allow buildtargets in generator's process function#15916

Draft
bonzini wants to merge 4 commits into
mesonbuild:masterfrom
bonzini:allow-targets-in-generator
Draft

Allow buildtargets in generator's process function#15916
bonzini wants to merge 4 commits into
mesonbuild:masterfrom
bonzini:allow-targets-in-generator

Conversation

@bonzini

@bonzini bonzini commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

From #9290

This change permits a generator to consume outputs by any target instead of failing.

This is helpful to create objcopy generators. I want to use objcopy and an python script to generate a header to embed an executable inside another executable for an dual core embedded target.

@bonzini bonzini requested a review from jpakkane as a code owner June 10, 2026 10:52
@bonzini bonzini added this to the 1.12 milestone Jun 10, 2026
@bonzini bonzini force-pushed the allow-targets-in-generator branch 3 times, most recently from 5ff4efd to efbe039 Compare June 12, 2026 15:35
@bonzini bonzini marked this pull request as draft June 12, 2026 15:35
@bonzini bonzini force-pushed the allow-targets-in-generator branch 4 times, most recently from 4bb6300 to a3ac089 Compare June 15, 2026 13:08
@bonzini

bonzini commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

ebc9a67, the first patch in this tree, somehow makes the VS backend very flaky. But this makes no sense. :(

bonzini and others added 4 commits June 16, 2026 00:44
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The only effect of generate_genlist_for_target on non-GeneratedLists
is to add elements to the parameters, but those are ignored in this
specific recursive call.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
generate_genlist_for_target works on all generated sources, and has
a silly do-nothing recursion for custom targets when operating on
genlist.depends.  Clarify that the genlist.depends recursion only
needs to do something if it finds another generator.

The old code would need changes if BuildTargets were added to
genlist.depends; the new one does not.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Co-authored-by: Jens Wolvers <13272708+JWolvers@users.noreply.github.com>
@bonzini bonzini force-pushed the allow-targets-in-generator branch 2 times, most recently from 2d9e92f to b02868e Compare June 15, 2026 22:50
@bonzini bonzini modified the milestones: 1.12, 1.13 Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant