diff options
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 4fc5efb..a1fc268 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -37,7 +37,7 @@ cmDependsC::cmDependsC() //---------------------------------------------------------------------------- cmDependsC::cmDependsC(cmLocalGenerator* lg, const char* targetDir, - const char* lang, + const std::string& lang, const std::map<std::string, DependencyVector>* validDeps) : cmDepends(lg, targetDir) , ValidDeps(validDeps) @@ -54,14 +54,14 @@ cmDependsC::cmDependsC(cmLocalGenerator* lg, std::string scanRegexVar = "CMAKE_"; scanRegexVar += lang; scanRegexVar += "_INCLUDE_REGEX_SCAN"; - if(const char* sr = mf->GetDefinition(scanRegexVar.c_str())) + if(const char* sr = mf->GetDefinition(scanRegexVar)) { scanRegex = sr; } std::string complainRegexVar = "CMAKE_"; complainRegexVar += lang; complainRegexVar += "_INCLUDE_REGEX_COMPLAIN"; - if(const char* cr = mf->GetDefinition(complainRegexVar.c_str())) + if(const char* cr = mf->GetDefinition(complainRegexVar)) { complainRegex = cr; } @@ -91,7 +91,7 @@ cmDependsC::~cmDependsC() { this->WriteCacheFile(); - for (std::map<cmStdString, cmIncludeLines*>::iterator it= + for (std::map<std::string, cmIncludeLines*>::iterator it= this->FileCache.begin(); it!=this->FileCache.end(); ++it) { delete it->second; @@ -116,7 +116,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, return false; } - std::set<cmStdString> dependencies; + std::set<std::string> dependencies; bool haveDeps = false; if (this->ValidDeps != 0) @@ -149,7 +149,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, this->Encountered.insert(*srcIt); } - std::set<cmStdString> scanned; + std::set<std::string> scanned; // Use reserve to allocate enough memory for tempPathStr // so that during the loops no memory is allocated or freed @@ -182,7 +182,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, } else { - std::map<cmStdString, cmStdString>::iterator + std::map<std::string, std::string>::iterator headerLocationIt=this->HeaderLocationCache.find(current.FileName); if (headerLocationIt!=this->HeaderLocationCache.end()) { @@ -224,7 +224,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, scanned.insert(fullName); // Check whether this file is already in the cache - std::map<cmStdString, cmIncludeLines*>::iterator fileIt= + std::map<std::string, cmIncludeLines*>::iterator fileIt= this->FileCache.find(fullName); if (fileIt!=this->FileCache.end()) { @@ -269,16 +269,22 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // written by the original local generator for this directory // convert the dependencies to paths relative to the home output // directory. We must do the same here. - internalDepends << obj << std::endl; - for(std::set<cmStdString>::const_iterator i=dependencies.begin(); + std::string obj_i = + this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT); + std::string obj_m = + this->LocalGenerator->ConvertToOutputFormat(obj_i, + cmLocalGenerator::MAKERULE); + internalDepends << obj_i << std::endl; + + for(std::set<std::string>::const_iterator i=dependencies.begin(); i != dependencies.end(); ++i) { - makeDepends << obj << ": " << - this->LocalGenerator->Convert(i->c_str(), + makeDepends << obj_m << ": " << + this->LocalGenerator->Convert(*i, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKEFILE) + cmLocalGenerator::MAKERULE) << std::endl; - internalDepends << " " << i->c_str() << std::endl; + internalDepends << " " << *i << std::endl; } makeDepends << std::endl; @@ -392,7 +398,7 @@ void cmDependsC::WriteCacheFile() const cacheOut << this->IncludeRegexComplainString << "\n\n"; cacheOut << this->IncludeRegexTransformString << "\n\n"; - for (std::map<cmStdString, cmIncludeLines*>::const_iterator fileIt= + for (std::map<std::string, cmIncludeLines*>::const_iterator fileIt= this->FileCache.begin(); fileIt!=this->FileCache.end(); ++fileIt) { @@ -421,7 +427,7 @@ void cmDependsC::WriteCacheFile() const //---------------------------------------------------------------------------- void cmDependsC::Scan(std::istream& is, const char* directory, - const cmStdString& fullName) + const std::string& fullName) { cmIncludeLines* newCacheEntry=new cmIncludeLines; newCacheEntry->Used=true; |