BUG: Only use the existing CMake(lang)Compiler.cmake file from the build tree if it was generated by the same version of CMake.
This commit is contained in:
parent
df301a2542
commit
2e451961b6
@ -207,23 +207,33 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
|
|||||||
"broken CMakeLists.txt file or a problematic release of "
|
"broken CMakeLists.txt file or a problematic release of "
|
||||||
"CMake");
|
"CMake");
|
||||||
}
|
}
|
||||||
// try and load the configured file first
|
|
||||||
std::string loadedLang = "CMAKE_";
|
// If the existing build tree was already configured with this
|
||||||
loadedLang += lang;
|
// version of CMake then try to load the configured file first
|
||||||
loadedLang += "_COMPILER_LOADED";
|
// to avoid duplicate compiler tests.
|
||||||
if(!mf->GetDefinition(loadedLang.c_str()))
|
unsigned int cacheMajor = mf->GetCacheMajorVersion();
|
||||||
|
unsigned int cacheMinor = mf->GetCacheMinorVersion();
|
||||||
|
unsigned int selfMajor = cmMakefile::GetMajorVersion();
|
||||||
|
unsigned int selfMinor = cmMakefile::GetMinorVersion();
|
||||||
|
if(selfMajor == cacheMajor && selfMinor == cacheMinor)
|
||||||
{
|
{
|
||||||
fpath = rootBin;
|
std::string loadedLang = "CMAKE_";
|
||||||
fpath += "/CMake";
|
loadedLang += lang;
|
||||||
fpath += lang;
|
loadedLang += "_COMPILER_LOADED";
|
||||||
fpath += "Compiler.cmake";
|
if(!mf->GetDefinition(loadedLang.c_str()))
|
||||||
if(cmSystemTools::FileExists(fpath.c_str()))
|
|
||||||
{
|
{
|
||||||
if(!mf->ReadListFile(0,fpath.c_str()))
|
fpath = rootBin;
|
||||||
|
fpath += "/CMake";
|
||||||
|
fpath += lang;
|
||||||
|
fpath += "Compiler.cmake";
|
||||||
|
if(cmSystemTools::FileExists(fpath.c_str()))
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("Could not find cmake module file:", fpath.c_str());
|
if(!mf->ReadListFile(0,fpath.c_str()))
|
||||||
|
{
|
||||||
|
cmSystemTools::Error("Could not find cmake module file:", fpath.c_str());
|
||||||
|
}
|
||||||
|
this->SetLanguageEnabled(lang, mf);
|
||||||
}
|
}
|
||||||
this->SetLanguageEnabled(lang, mf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user