ezvcpkg
ezvcpkg copied to clipboard
Support the CLEAN directive, cleaning up old builds
if I'm developing over a long period of time and my ezvcpkg dependencies change (in a way that requires that the commit ID I use changes), this implies that I'm leaving old ezvcpkg/commitID
folders in place that may be taking up significant disk space.
The intent of the CLEAN n
option to the EZVCPKG_FETCH
command is that if a given commit ID in the base directory hasn't been used for N days, then it is safe to wipe that build, releasing the disk space.
There are two blockers for implementing this. First, I have no idea how to, using only CMake, ask how many days old a given file is. Second, each folder contains a file that is touched whenever CMake is run, but it's not touched when the subsequent CMake generated build executes. If a user doesn't re-run cmake then the build folder they're using may be considered out of date. The solution might be to add a custom command that touches the file on every build, but I'm not sure if that's possible when ezvcpkg_fetch is called prior to the CMake project
directive.