-
-
Notifications
You must be signed in to change notification settings - Fork 828
Builder tweak to improve Mbed CE support #5250
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
base: develop
Are you sure you want to change the base?
Builder tweak to improve Mbed CE support #5250
Conversation
Sounds like what is already done in existing builder scripts for e.g. ArduinoCore-mbed Not sure if this really really needs that PlatformIO core tweak. |
For Tweak 2: Did you try setting up only a dependency of the final ELF to the include file? Like env.Depends(target_elf, "path/to/global_include.h") in the |
Yes I did. That just causes the elf file to get relinked, without compiling any of its sources |
@maxgerhardt Excellent find! You are right, using _LIBFLAGS allows me to avoid needing the first tweak. |
I could have sworn I've seen something in the builder script logic for ESP-IDF trigger an entire rebuild of the project if the Does the |
Hi! I'm working on adding support for the Mbed CE framework to PlatformIO (forum thread for context). I've nearly gotten it working, but I have to make two small tweaks to the platformio builder logic to get everything running.
Tweak 1: PIO_EXTRA_APP_OBJS
Update: This is not needed anymore and is removed in the latest version of the PR.
Tweak 2: PIO_EXTRA_APP_SOURCE_DEPS
Mbed CE has a ton of #defines that need to be added for every single source file, and rather than make the compiler command line tens of kilobytes long, we write these out to an include file and then force every source file to include this using the
-include
compiler flag.The problem is that SCons doesn't seem to consider
-include
when scanning dependencies, so if the header gets modified, the source files that depend on it aren't rebuilt. This is a big issue with Mbed CE because it means that a manual clean would be required after editing the mbed_app.json file rather than things rebuilding automatically.To fix this problem, I added a new
PIO_EXTRA_APP_SOURCE_DEPS
env var. Every application obj file is made to depend on all files in this list, so the app sources will be recompiled if any of these files are changed. This way, I can set the variable to point to the-include
-ed header and the dependencies will be handled properly.P.S. I am still new to PlatformIO so please let me know if there's a better name or location for this functionality and I will happily rework it!