Use shortest extension to verify try_compile language (#11731)

If the source-file form of try_compile is given a file name with
multiple '.' characters such as "a.b.c" use only the shortest extension
to check the language.  This is the expected behavior and is consistent
with normal language extension determination in the method
cmSourceFileLocation::UpdateExtension.
This commit is contained in:
Brad King 2011-01-20 09:02:57 -05:00
parent 1bee6b172b
commit 699a725584
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
}
std::string source = argv[2];
std::string ext = cmSystemTools::GetFilenameExtension(source);
std::string ext = cmSystemTools::GetFilenameLastExtension(source);
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");