Please, could you explain the statement? I’m facing the same problem than the op but I have no scape/workaround as define an env var. That “indirect inclusion” doesn’t work for me.
In my case, it’s a rather large library (I’m trying to convert a big project that only uses ino files) and it’s not feasible to go full include in multiple files.
I see that you’re more experienced than me. Can you please take a look into an already made library that I’m used to?
The part that I’n interested into is the macros relative to serial output.
In MyConfig.h@163 there’s a macro for serial speed.
This header is included in the main library file (entry point)@43 that it has to be included in your sketch file.
This macro is later consumed in a source file at hal/architecture/ESP8266/MyHwESP8266.cpp@25 . This later source file doesn’t have any direct reference to the config header, but it’s been proved that it works.
Now, I’ve tried to reproduce this library, to test the issue, only including the minimum code for debug prints, but compiler complains about all the defines at the ESP8266 level.
And I tried putting an include in the MyHwESP8266.cpp to the header config file (very ugly as it’s four folder sublevels below) and the result is that as the compiler also doesn’t recognize the macro of the include guard defined before, it breaks with multiple definition errors.
I have the impression that I’m doing something terribly wrong, but I don’t know what.