If a project depends on some libraries, there are basically two options available:
- Locate the libraries in a well known global path (like
/usr/src/linux-headers-4.13.0-1-amd64/
- Copy the sources into the project folder.
Using the global location approach takes minimum space and time (download time). If the dependencies are well versioned (tagged, like v3.1
, v3.1.1
, etc...), this option just works well.
If our project needs to use the latest commit of the library, versioning is not an option. If we just pull the latest commit into the well known location and let our project use the library, chances are we will be unable to compile our project 6 months later, which is unacceptable.
If we add the dependency as a subproject into our project, we will always be able to compile our project. This is the safest approach. Problem is that if the library is around 100MB, copying sources into the project folder is just a waste of disk usage, download time etc...
How do the people handle this problem?