Simplify VS CMake re-run check
When CMake is invoked by the VS IDE re-run rule we compute whether or not CMake really needs to re-run based on some timestamp helper files. Previously we assumed that if the main generate.stamp file exists then VS has correctly detected that the file is out of date. However, this assumption is too aggressive and re-runs CMake unnecessarily sometimes. This commit removes the assumption and always checks timestamps itself. The change breaks the explicit user re-run request (R-click -> Compile) but only in cases when the build system is already up to date.
This commit is contained in:
parent
524bb1e36e
commit
053519b390
|
@ -3880,17 +3880,6 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static bool cmakeCheckStampFile(const char* stampName)
|
static bool cmakeCheckStampFile(const char* stampName)
|
||||||
{
|
{
|
||||||
// If the stamp file still exists then it must really be out of
|
|
||||||
// date.
|
|
||||||
if(cmSystemTools::FileExists(stampName))
|
|
||||||
{
|
|
||||||
// Notify the user why CMake is re-running. It is safe to
|
|
||||||
// just print to stdout here because this code is only reachable
|
|
||||||
// through an undocumented flag used by the VS generator.
|
|
||||||
std::cout << "CMake is re-running because build system is out-of-date.\n";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The stamp file does not exist. Use the stamp dependencies to
|
// The stamp file does not exist. Use the stamp dependencies to
|
||||||
// determine whether it is really out of date. This works in
|
// determine whether it is really out of date. This works in
|
||||||
// conjunction with cmLocalVisualStudio7Generator to avoid
|
// conjunction with cmLocalVisualStudio7Generator to avoid
|
||||||
|
|
Loading…
Reference in New Issue