diff options
author | Brad King <brad.king@kitware.com> | 2011-01-20 14:02:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-01-20 14:02:57 (GMT) |
commit | 699a7255847ba8b348ba63a2244b5b57b328261c (patch) | |
tree | 12078091b944eb27af90b10e8eebba8e53303595 /Source/cmCoreTryCompile.cxx | |
parent | 1bee6b172bdeb4c02cafbc98d162e8d2cfd5c53f (diff) | |
download | CMake-699a7255847ba8b348ba63a2244b5b57b328261c.zip CMake-699a7255847ba8b348ba63a2244b5b57b328261c.tar.gz CMake-699a7255847ba8b348ba63a2244b5b57b328261c.tar.bz2 |
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.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0ea6c5e..d636cb8 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -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"); |