I have a lot of code that is needed for several projects - units, include files, resources and more. These files are writen by myself, downloaded or cloned with git and have their own place in the directory structure.
These (source)files have to be accessible during compilation. Now I'm struggling with two different possibilities how that can be accomplished:
- Copy the relevant files into my project source tree
- Use the files with a (relative)path
Copy files
Pro
- The project can always be compiled
- All neccessary files will be commited with git
Con
- I don't benefit autmatically from bugfixes and have to check manually if there are are newer versions
- Copies of the same code at various plces
Use path
Pro
- Bug fixes are a automatically included during the next build
- I don't have the check which files have to be copied additionally
Con
- Major changes in the referenced files can make my project uncompilable
- Relevant files of the project are missing in the repository
How do you deal with this problem? Is there a way to have the best of both worlds?
In the case that it matters: I'm working most of the time under Windows with Free Pascal, Forth, Assembler, Verilog.