summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-12-20 19:21:43 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-12-20 19:21:43 (GMT)
commit7ca69a08cba0a28791dbb98b68b11e89ba5cafa4 (patch)
tree3da891c3ecf72e0dea6f4d290a2b4512e3fe23d8
parent7868061a6ba5a29a937e120cc6f3fe526396c5d4 (diff)
parent318b0cdf2306a9198baa837885d65423e5f7fc96 (diff)
downloadCMake-7ca69a08cba0a28791dbb98b68b11e89ba5cafa4.zip
CMake-7ca69a08cba0a28791dbb98b68b11e89ba5cafa4.tar.gz
CMake-7ca69a08cba0a28791dbb98b68b11e89ba5cafa4.tar.bz2
Merge topic 'AddCommentToCDependencyScanner'
318b0cd Add comment about one more problem of the C depency scanner. 4bb08e0 Remove trailing whitespace
-rw-r--r--Source/cmDependsC.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index a76b3af..44841a9 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -237,10 +237,10 @@ bool cmDependsC::WriteDependencies(const char *src, const char *obj,
fileIt->second->Used=true;
dependencies.insert(fullName);
for (std::vector<UnscannedEntry>::const_iterator incIt=
- fileIt->second->UnscannedEntries.begin();
+ fileIt->second->UnscannedEntries.begin();
incIt!=fileIt->second->UnscannedEntries.end(); ++incIt)
{
- if (this->Encountered.find(incIt->FileName) ==
+ if (this->Encountered.find(incIt->FileName) ==
this->Encountered.end())
{
this->Encountered.insert(incIt->FileName);
@@ -278,7 +278,7 @@ bool cmDependsC::WriteDependencies(const char *src, const char *obj,
for(std::set<cmStdString>::iterator i=dependencies.begin();
i != dependencies.end(); ++i)
{
- makeDepends << obj << ": " <<
+ makeDepends << obj << ": " <<
this->LocalGenerator->Convert(i->c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -321,9 +321,9 @@ void cmDependsC::ReadCacheFile()
haveFileName=true;
int newer=0;
cmFileTimeComparison comp;
- bool res=comp.FileTimeCompare(this->CacheFileName.c_str(),
+ bool res=comp.FileTimeCompare(this->CacheFileName.c_str(),
line.c_str(), &newer);
-
+
if ((res==true) && (newer==1)) //cache is newer than the parsed file
{
cacheEntry=new cmIncludeLines;
@@ -391,7 +391,7 @@ void cmDependsC::WriteCacheFile() const
{
return;
}
-
+
cacheOut << this->IncludeRegexLineString << "\n\n";
cacheOut << this->IncludeRegexScanString << "\n\n";
cacheOut << this->IncludeRegexComplainString << "\n\n";
@@ -406,7 +406,7 @@ void cmDependsC::WriteCacheFile() const
cacheOut<<fileIt->first.c_str()<<std::endl;
for (std::vector<UnscannedEntry>::const_iterator
- incIt=fileIt->second->UnscannedEntries.begin();
+ incIt=fileIt->second->UnscannedEntries.begin();
incIt!=fileIt->second->UnscannedEntries.end(); ++incIt)
{
cacheOut<<incIt->FileName.c_str()<<std::endl;
@@ -431,7 +431,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
cmIncludeLines* newCacheEntry=new cmIncludeLines;
newCacheEntry->Used=true;
this->FileCache[fullName]=newCacheEntry;
-
+
// Read one line at a time.
std::string line;
while(cmSystemTools::GetLineFromStream(is, line))
@@ -465,6 +465,9 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
// that this check does not account for the possibility of two
// headers with the same name in different directories when one
// is included by double-quotes and the other by angle brackets.
+ // It also does not work properly if two header files with the same
+ // name exist in different directories, and both are included from a
+ // file their own directory by simply using "filename.h" (#12619)
// This kind of problem will be fixed when a more
// preprocessor-like implementation of this scanner is created.
if (this->IncludeRegexScan.find(entry.FileName.c_str()))