diff options
-rw-r--r-- | Source/cmSourceFile.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 39074a5..517b570 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -55,16 +55,14 @@ std::string const& cmSourceFile::GetOrDetermineLanguage() } // Perform computation needed to get the language if necessary. - if (this->FullPath.empty() && this->Language.empty()) { - // If a known extension is given or a known full path is given - // then trust that the current extension is sufficient to - // determine the language. This will fail only if the user - // specifies a full path to the source but leaves off the - // extension, which is kind of weird. - if (this->Location.ExtensionIsAmbiguous() && + if (this->Language.empty()) { + // If a known extension is given or a known full path is given then trust + // that the current extension is sufficient to determine the language. This + // will fail only if the user specifies a full path to the source but + // leaves off the extension, which is kind of weird. + if (this->FullPath.empty() && this->Location.ExtensionIsAmbiguous() && this->Location.DirectoryIsAmbiguous()) { - // Finalize the file location to get the extension and set the - // language. + // Finalize the file location to get the extension and set the language. this->ResolveFullPath(); } else { // Use the known extension to get the language if possible. |