Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cbuild2cmake] Trigger project executes after project build step #195

Conversation

EaselinkBachmann
Copy link
Contributor

@EaselinkBachmann EaselinkBachmann commented Sep 26, 2024

This PR adds a new CONTEXT-executes target to CMake that is automatically run after build that triggers the executes statements that depend on the build outputs of that project.

Fixes #185.

This is the local fix that I described in cbuild#244. I'm not sure if this is exactly how you intend on resolving this, but I'm providing my patch in the hope that it will be useful.

@EaselinkBachmann EaselinkBachmann force-pushed the feature/trigger-executes-on-build branch from 1972748 to f0ad603 Compare September 26, 2024 10:16
@jkrech jkrech requested a review from brondani October 1, 2024 05:49
@EaselinkBachmann EaselinkBachmann force-pushed the feature/trigger-executes-on-build branch 2 times, most recently from 8424e92 to ded205c Compare October 8, 2024 08:14
@EaselinkBachmann EaselinkBachmann force-pushed the feature/trigger-executes-on-build branch from ded205c to e8eed57 Compare October 8, 2024 12:00
@EaselinkBachmann
Copy link
Contributor Author

EaselinkBachmann commented Oct 8, 2024

Fixed to also correctly work with solution level executes. Each execute statement is now added to the ${CONTEXT}-executes target of each context in the execute statement's depends-on: key.

Currently doesn't deal with multiple dependent executes statements though (i.e., an executes-A depends on executes-B depends on context-X currently leads to executes-A not being automatically run). Handling these kinds of transitive reverse-dependencies is difficult.

@EaselinkBachmann EaselinkBachmann force-pushed the feature/trigger-executes-on-build branch from e8eed57 to 0925de3 Compare October 16, 2024 09:17
This adds a new CONTEXT-executes target to CMake that is automatically
run after build that triggers the executes statements of that project.
Fixes Open-CMSIS-Pack#185.
@EaselinkBachmann EaselinkBachmann force-pushed the feature/trigger-executes-on-build branch from 0925de3 to 2c51a89 Compare October 22, 2024 09:14
@brondani
Copy link
Collaborator

I'm not sure if this is exactly how you intend on resolving this, but I'm providing my patch in the hope that it will be useful.

Actually my proposal was slightly different, I was thinking on fully replacing the context-level "post-build" entries add_custom_target/add_custom_command by ExternalProject_Add_Step, but I like your solution.
Thanks for this contribution!

Currently doesn't deal with multiple dependent executes statements though (i.e., an executes-A depends on executes-B depends on context-X currently leads to executes-A not being automatically run). Handling these kinds of transitive reverse-dependencies is difficult.

Possibly this could be solved by iterating again over the depends-on until no further dependency is found. We can address that in a second moment.

@brondani brondani merged commit 86914f0 into Open-CMSIS-Pack:main Oct 23, 2024
14 checks passed
@EaselinkBachmann EaselinkBachmann deleted the feature/trigger-executes-on-build branch October 24, 2024 10:34
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.

[cbuild2cmake] Use ExternalProject_Add_Step for post-build executes
2 participants