summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSourceFile.cxx18
1 files changed, 7 insertions, 11 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 0a848f6..3ee3708 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -55,7 +55,13 @@ const char* cmSourceFile::GetLanguage()
// Perform computation needed to get the language if necessary.
if(this->FullPath.empty() && this->Language.empty())
{
- if(this->Location.ExtensionIsAmbiguous())
+ // 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() &&
+ this->Location.DirectoryIsAmbiguous())
{
// Finalize the file location to get the extension and set the
// language.
@@ -185,16 +191,6 @@ bool cmSourceFile::FindFullPath()
}
}
- // If the user provided a full path, trust it. If the file is not
- // there the native tool will complain at build time.
- if(!this->Location.DirectoryIsAmbiguous())
- {
- this->FullPath = this->Location.GetDirectory();
- this->FullPath += "/";
- this->FullPath += this->Location.GetName();
- return true;
- }
-
cmOStringStream e;
e << "Cannot find source file \"" << this->Location.GetName() << "\"";
e << ". Tried extensions";