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:
Brad King 2005-02-24 10:32:58 -05:00
parent df301a2542
commit 2e451961b6

View File

@ -207,7 +207,16 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
"broken CMakeLists.txt file or a problematic release of "
"CMake");
}
// try and load the configured file first
// If the existing build tree was already configured with this
// version of CMake then try to load the configured file first
// to avoid duplicate compiler tests.
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)
{
std::string loadedLang = "CMAKE_";
loadedLang += lang;
loadedLang += "_COMPILER_LOADED";
@ -226,6 +235,7 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
this->SetLanguageEnabled(lang, mf);
}
}
}
needTestLanguage = true; // must test a language after finding it
// read determine LANG compiler