Library Manager downloads libraries, which are notrequired by the project

Well that’s the wrong approach!

I know, however, that such a sharing of libraries is againts Platformio startegy…

For a good reason - as you have found out :wink:

But you can use symlink instead to have some similiar but working behavior.

lib_deps = 
  symlink://path-to-Utils.h
  symlink://path-to-Blink.h

Take a look at this post:

If you have a folder strukture like this:

.
β”œβ”€β”€ libraries
β”‚   β”œβ”€β”€ LibA
β”‚   β”œβ”€β”€ LibB
β”‚   └── LibC
└── projects
    β”œβ”€β”€ ProjectA
    β”œβ”€β”€ ProjectB
    └── ProjectC

Then you can use relative symlinks.

Example:

Project-B depends on LibA and LibC
platformio.ini of ProjectB:

lib_deps = 
  symlink://../../libraries/LibA
  symlink://../../libraries/LibB

This ensures that only LibA and LibB are used to build ProjectB but not every library in the libraries folder.