Library manager is adding a non compatible library (arduino due) when the include is guarded on source code with a #ifndef directive.
this cause the same project to compile on arduino-ide and not on platformio, platformio is trying to compile the non-compatible library resulting in several errors.
I’ve checked that the define exists also on platformio.
FURTHER INVESTIGATION --------------
this is quite odd!
on my main file i can use:
#ifdef ARDUINO_SAM_DUE
#warning DUE IS PRESENT!!!!!!!!!!!!!!!!!!!!!!!!!!!
#endif
and see that ARDUINO_SAM_DUE is defined (ok, as expected).
On some include file (.h) that is present (i’m building/testing a library) but not included on my main file test i can have both:
#ifdef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
#endif
#ifndef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
#endif
and see that no error is trigered for that XXXXXXXXXXX as expected (i have not included the file)
however if i have:
#ifndef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
#include <ClickEncoder.h>
#endif
i have some errors (because that file is not due compatible) in spite that i’m not including the file the error is triggered.
on this case the errors disappear, even if the include file does not exist
#ifndef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
#include <xClickEncoder.h>
#endif
but using multi-line comment the error persists
#ifndef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
/*
#include <xClickEncoder.h>
*/
#endif
i can make it disapear again like this
#ifndef ARDUINO_SAM_DUE
XXXXXXXXXXXXXXXXXXX
/*
//#include <xClickEncoder.h>
*/
#endif
so something very wrong is happening with the python dependency check emulating the compiler.
- should not try to mark a dependency on non included files
- should respect (ignore) multi-line comments
- even if the file was included it should obey the #ifndef directive
thanks