By default when I need to re-use code over and over, I use submodules. Sometimes there will be situations where submodules are overkill, for example in a project where I know I wont need to re-use the code over and over but maybe in only up to 3 places, then I do something like this.
The first thought is to just use symlinks, but symlinks may vary per operating system platform, but something that always works is just copying the files to where they need to be, when they are updated then you just re-copy and clobber the exsting files to get the update out, this will work on all platforms, so here's how we can do that.
Then I have a filesymlinks.txt
which have the following contents:
sphere_orbiter -> ../single_player/src/system_logic/sphere_orbiter
random_vector -> ../single_player/src/system_logic/random_vector
sphere_orbiter -> ../server/src/system_logic/sphere_orbiter
random_vector -> ../server/src/system_logic/random_vector