I have a GitHub repository I have tried to set up as a library to use for other Platformio projects. It used to work fine. But since my last playing around (~9 months ago) something seem to have change in the Platformio library handling. When I install my library, it “squashes” the file structure and places everything in the library root. This is really not (my) wanted behaviour. I expect the file structure to be kept, for both readability and compatability with other build methods.
Minimal example:
LibraryRoot
...
|-- include
| |-- foo
| | |-- foo.h
becomes after installation (lib_deps
or pio lib install ...
)
ProjectRoot
|-- .pio
| |-- libdeps
| | |-- MyEnv
| | | |-- LibraryRoot
| | | | |-- foo.h
It used to be installed as
ProjectRoot
|-- .pio
| |-- libdeps
| | |-- MyEnv
| | | |-- LibraryRoot
| | | | |-- foo
| | | | | |-- foo.h
Thus, I now have to include foo.h
with #include<foo.h>
, not #include<foo/foo.h>
which is what I claim is the more commonly expected. What is the reasoning behind the “file structure squashing”? Could someone explain that to me?
Also, is there a way to install a library while keeping its files structure? Or do I have to make my code Platformio-specific, ditching any attempts on making compatible and scalable code? I have not yet found anything in the LDF docs that could help me. Is there something in the library configuration files - which I have not currently implemented - that could help me?
I use VSCode.