mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-09 01:01:12 +00:00
VS: Compute project GUIDs deterministically
Compute deterministic GUIDs that are unique to the build tree by hashing the path to the build tree with the GUID logical name. Avoid storing them in the cache, but honor any found there. This will allow project GUIDs to be reproduced in a fresh build tree so long as its path is the same as the original, which may be useful for incremental builds.
This commit is contained in:
@@ -82,8 +82,6 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
|
||||
// Now create GUIDs for targets
|
||||
cmTargets &tgts = this->Makefile->GetTargets();
|
||||
|
||||
cmGlobalVisualStudio7Generator* gg =
|
||||
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
|
||||
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
|
||||
{
|
||||
if(l->second.GetType() == cmTarget::INTERFACE_LIBRARY)
|
||||
@@ -96,10 +94,6 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
|
||||
this->ReadAndStoreExternalGUID(
|
||||
l->second.GetName().c_str(), path);
|
||||
}
|
||||
else
|
||||
{
|
||||
gg->CreateGUID(l->first.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2312,12 +2306,9 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID(
|
||||
{
|
||||
cmVS7XMLParser parser;
|
||||
parser.ParseFile(path);
|
||||
// if we can not find a GUID then create one
|
||||
// if we can not find a GUID then we will generate one later
|
||||
if(parser.GUID.size() == 0)
|
||||
{
|
||||
cmGlobalVisualStudio7Generator* gg =
|
||||
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
|
||||
gg->CreateGUID(name);
|
||||
return;
|
||||
}
|
||||
std::string guidStoreName = name;
|
||||
|
||||
Reference in New Issue
Block a user