Caching¶
vcpkg caches many packages under the hood and reuses them whenever possible.
It mostly is the case if a package has previously been built for a project and another project uses the exast same version of the package.
vcpkg rely on package ABI (Application Binary Interface) to identify each package and determine if it can be reused. This can depend on many things:
package version,
port version,
target triplet,
host triplet,
and many others.
If the port hash is the same vcpkg will not rebuild the package and will instead use the cached one by copying results into:
The
vcpkg_installeddirectory of the new project if using vcpkg manifest mode.The local vcpkg repository if using vcpkg classic mode.
This is why the following installation sections prefer to first
install packages using the vcpkg install command before
using it via CMake later during configuration phase.
Errors are more easily spotted during the first part, and if
the first installation is successfull, caching will allow to
reuse the same packages during configuration as long as the
package’s ABI is identical.
vcpkg stores its cache in common cache places, e.g. on Windows:
$env:LOCALAPPDATA,or
C:\Users\<user>\AppData\Local.
See also
For more information: vcpkg binary caching