Skip to content

Update mbed-cli to allow different configured path for mbed-os #626

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

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

daid
Copy link
Contributor

@daid daid commented Feb 14, 2018

In not every project structure it makes sense to have the mbed-os directory at the root of your project structure.
This change allows you to configure a custom path for the mbed-os directory in your .mbed configuration.

In our case, our project calls for multiple firmware builds. But we do not want checkout mbed-os per firmware. mbed-cli allows this with the --source parameter, however, it does require that mbed-os is in the root of the project.

With this change we can setup mbed-os in a better subfolder to allow for a better project structure:

extlibs/mbed-os
module/mobuleA
module/moduleB
project/project1
project/project2

And compile those with:

mbed-cli config MBED_OS_DIR extlibs/mbed-os/
mbed-cli compile -f --profile release --source project/project1 --source module --source extlibs/mbed-os --build BUILD/project1
mbed-cli compile -f --profile release --source project/project2 --source module --source extlibs/mbed-os --build BUILD/project2

In not every project structure it makes sense to have the mbed-os directory at the root of your project structure.
This change allows you to configure a custom path for the mbed-os directory in your .mbed configuration
@theotherjimmy
Copy link
Contributor

This is a very interesting, and quite simple, change. I'm okay with it. @screamerbg What do you think?

@0Grit
Copy link

0Grit commented Feb 14, 2018

Yes please. I'd like to use this to support adding mbed-os as a git submodule versus having mbed-cli import it.

@screamerbg
Copy link
Contributor

@daid As @theotherjimmy pointed, it's a simple and non-breaking change. Thanks!

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Wonderful small diff!

@theotherjimmy theotherjimmy merged commit eae8f9d into ARMmbed:master Feb 20, 2018
@bmcdonnell-ionx
Copy link
Contributor

Does this work with exporters?

@theotherjimmy
Copy link
Contributor

@bmcdonnell-ionx This should work with all mbed verbs, export included.

@daid
Copy link
Contributor Author

daid commented Feb 27, 2018

@bmcdonnell-ionx #590 is a bigger problem for complex project setups with the exporter. As this patch only helps the python tools find the actual exporter (and more things), I don't think it causes any problems. And any problems that it would cause are most likely bugs due to wrong assumptions on paths.

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.

5 participants