Let's say I have several small standalone projects, all using their own git repository.
This could be in any language I guess, but in practice, I'm interested mostly in C, C++, and Java.
Alongside and supporting these projects, I have a variety of small utility functions and classes, a "personal standard library" if you will (hereafter I'll call this "the lib" - but keep in mind it is not a monolithic thing: you can pick and choose pieces from it). In most of my projects, I use one or more of the files from this library.
I am looking for some way to manage this situation. Each git repository should be standalone in the sense that if you clone the project alone it comes with all the files needed to compile it. That is, I don't want to add the entire lib as a submodule (indeed, some projects may be a couple of source files, one of which comes from the lib and I don't want to import 100 other files).
Each project should be able to pick and choose which files from lib it consumes. If I update lib, ideally there should be a simple way for projects to pick up the updates.
I considered symlinks: each project symlinks to the files it wants from lib, but git doesn't follow symlinks. I considered hardlinks - maybe this works? It doesn't seem very portable to file systems that don't support hard links.
How can I accomplish my goals?