In our ventilator project, we use a hack to compile different programs on the same environment (our integration testing environment) by using an environment variable to define the path to a h file, and use it as such in main.cpp: #include INTEGRATION_TEST_H
The h file to which INTEGRATION_TEST_H leads most of the times includes headers from libraries, and when trying this with development version (6.1.0rc1), it appears ldf cannot find those libraries.
I have a workaround which is to include one header file from each of our libraries in main.cpp, but this seems hard to maintain.
Then there might a regression in the LDF in regards to this (rather complex) substitution of macros and discovery of libraries. Can you file an issue at Issues · platformio/platformio-core · GitHub pointing at the source code, or better a minimal reproduction of the problem?
This is correct behavior. We don’t parse anymore ALL includes from the projects if they were not included in the project. The PIO Core <6.1 parsed all files and we had very often issues when PIO included libraries to the compilation projects from the headers that WERE NOT USED in the project but were located in the “include” folder.
In your case, the default chain mode does not expose any C Preprocessor macros. Could you try switching to the lib_ldf_mode=chain+ ?
I just tested with chain+, it seems to work fine for some of our use cases, but we are using deep+, which is necessary for others, and seem not to evaluate #include INTEGRATION_TEST_H properly as of this writing.