Aha! Thanks. So your source code stayed where it was, in the global folder, and was not copied into the project. Any changes you made to the library source code, were propagated to the binary version linked into the project when the project itself was recompiled?
If this is the case, then my setup for my pseudo-global libraries does the same thing – I just tested it to be 100% certain. I did the following:
- Edited a function in my AVRusart library which lives in
platformio_libraries/AVRusart which is my own “Serial” interface look-alike library;
- Compiled a project which uses AVRusart by defining the following in
lib_extra_dirs = /path/to/platformio_libraries
- Changes appeared in the uploaded code;
- No source code for the library was copied to the project directories, only object files
*.o and a static library
So, in summary:
- Keep your downloaded and modified libraries in separate folders beneath a top-level globals folder;
- Add the path (relative or full) to the top-level folder to any project that needs a library you have written or downloaded;
- Do not mention any of those libraries in
- Add the appropriate header files to
#include "whatever.h" statements when libraries are required;
- Compile, upload and have fun!
It seems to work the way you would want it to work by doing this.
Me too - but sometimes the world moves out from underneath you! It seems that global libraries caused too many problems with same named libraries being written for different platforms/frameworks and the wrong libraries being linked by the linker.