-
-
Notifications
You must be signed in to change notification settings - Fork 398
Fix ARDUINO_LIB_DISCOVERY_PHASE automatic flag incompatiblity #838
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
Fix ARDUINO_LIB_DISCOVERY_PHASE automatic flag incompatiblity #838
Conversation
…phase (arduino#633)" This reverts commit 985b2c9.
Previously we used to add `-DARDUINO_LIB_DISCOVERY_PHASE` to the gcc command line but this produced some incompatiblity with compilers using non-standard `-d` flag instead of `-D`: arduino#633 (comment)
Won't this change cause I guess this is one situation where something like https://groups.google.com/a/arduino.cc/forum/#!topic/developers/H6vCRlgRTCo would be helpful... |
…INO_LIB_DISCOVERY_PHASE This is required after arduino/arduino-cli#838 is merged.
yes
uhm it shouldn't, I've imagined something like this: arduino/ArduinoCore-mbed#21 |
Oh, I missed the |
Yes it's a bit ugly... but this should allow the best compatibility. AFAIK
I reread the thread a "platform.txt" versioning is surely something nice to have. We may surely have designed the new feature in a less intrusive way from the beginning (like it is implemented in this PR for example) to be 100% sure it won't break anithing... but details are hard, is not always easy to figure out everything. |
Thanks @cmaglie I've a question about the define It is not clear for me if a core want's to use it ? |
Well, it might not just be platforms that need this, but sketches or libraries could also use it (but if not all platforms offer it, then it's not really a usable API I guess). I don't have any examples of this, just theoretical.
It could help to make things simpler, since arduino-cli can detect that a platform was adapted or not, and continue to add the -D version to older version of the platform, so the platform no longer has to care (though this does not fix the "defined twice" when a newer platform is used with an older arduino-cli. That could be fixed on the longer term if stuff in |
Only if your platform has a core made by a ton of header files that gets included from |
Previously we added
-DARDUINO_LIB_DISCOVERY_PHASE
to the gcc command line during the library discovery phase: unfortunately this has an incompatiblity with compilers using non-standard-d
flag instead of-D
as reported here: #633 (comment)To fix this behaviour this PR adds a new build variable
{build.library_discovery_phase}
that is set to1
during library discovery or to0
during normal build.The platforms that wants to use it may add in their
platform.txt
something like:and use
{build.library_discovery_phase_flag}
inside thegcc
command line.This way the gcc command line is not altered and all the other platforms not interested in this change will remain unaffected.
/cc @fpistm @facchinm