summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-27 17:10:09 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-27 17:10:09 (GMT)
commit73d5fd31ab1fe62956b7f2ae8ffffeb3a7281708 (patch)
tree0f1ca33a158b96e6d7845be8ef66399759d6548c /Source/cmSourceFile.cxx
parent1c0ffdc11c20376b5a353634e63bfcb0fafc1cc0 (diff)
downloadCMake-73d5fd31ab1fe62956b7f2ae8ffffeb3a7281708.zip
CMake-73d5fd31ab1fe62956b7f2ae8ffffeb3a7281708.tar.gz
CMake-73d5fd31ab1fe62956b7f2ae8ffffeb3a7281708.tar.bz2
ENH: Catch missing source files specified by full path earlier.
- Revert previous change to trust user-provided full paths. - Instead trust them only far enough to determine the source language but still check for existence for non-generated sources.
Diffstat (limited to 'Source/cmSourceFile.cxx')
-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";