-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add mbed-create-distro, a function to make adding multiple targets easy #14274
Conversation
@multiplemonomials, thank you for your changes. |
Thanks @multiplemonomials for the PR, that's great! I did some initial testing and I confirm it works. I'll provide a working example asap. |
Based on your experience, what would you choose from the options we got? would We will allocate time in the upcoming sprint. |
I think that cmake-object-libs is a better way but I don't really have the huge amount of time and energy it would require to make the change at this point in development. It's really up to you guys. Whether you're planning to implement it or not, I think it's worth merging this in the interim to provide a workaround for multiple target support. |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
Don't rebase yet. We are evaluating the approaches for the issue. We will get back to this. |
This pull request has automatically been marked as stale because it has had no recent activity. @multiplemonomials, please carry out any necessary work to get the changes merged. Thank you for your contributions. |
Our proposal is to use this object-libs approach. I created initial draft 0xc0170#21. This is a base for refactoring and testing to get entire tree fixed. I created feature branch here Thank you for providing this to get better understanding of the issue itself and how to resolve it. |
I'll close this. Please test feature-cmake-object-libraries and let that merge to master asap. |
Summary of changes
This PR adds mbed_create_distro(), a function that lets you compile multiple apps in an Mbed OS project without waiting for Mbed OS to build multiple times.
You can use it like this:
Both myapp1 and myapp2 will act like they were linked to mbed-os, mbed-storage-kvstore, and mbed-storage-filesystem. If you actually did that, it would compile a new version of the source files for each target. However, using mbed_create_distro(), Mbed OS will only be compiled once.
If merged, this will provide a satisfactory (though not very clean...) fix for #13981.
Note: I also had to provide a band-aid fix for #14220 in order to make the new code usable. As I discussed here, this works by just assuming that all application targets have the same compile defs in terms of what's needed by the linker script.
Impact of changes
mbed_create_distro() is now offered by the build system. This function replaces mbed_configure_app_target() and creates a separate "distribution" OBJECT library from the given Mbed OS libraries that only needs to be compiled once.
Migration actions required
None.
Documentation
Docs provided in code comments.
Pull request type
Test results
Reviewers
@0xc0170 @hugueskamba