ENH: Made cmSourceFile::GetDepends return reference to const so dependencies can be added only by an access method in cmSourceFile.

This commit is contained in:
Brad King 2007-05-28 10:11:44 -04:00
parent d2f62e6ac3
commit ba8ec0d5cf
5 changed files with 9 additions and 9 deletions

View File

@ -555,7 +555,7 @@ void CCONV cmSourceFileSetProperty(void *arg,const char *prop,
void CCONV cmSourceFileAddDepend(void *arg, const char *depend) void CCONV cmSourceFileAddDepend(void *arg, const char *depend)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
sf->GetDepends().push_back(depend); sf->AddDepend(depend);
} }
void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir, void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,

View File

@ -94,8 +94,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args)
no_working_dir); no_working_dir);
cmSourceFile *sf = this->Makefile->GetSource(cxxres.c_str()); cmSourceFile *sf = this->Makefile->GetSource(cxxres.c_str());
sf->GetDepends().push_back(hname); sf->AddDepend(hname.c_str());
sf->GetDepends().push_back(origname); sf->AddDepend(origname.c_str());
this->GeneratedSourcesClasses.push_back(sf); this->GeneratedSourcesClasses.push_back(sf);
} }
} }

View File

@ -82,7 +82,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn)
} }
this->WrapHeaders.push_back(hname); this->WrapHeaders.push_back(hname);
// add starting depends // add starting depends
file.GetDepends().push_back(hname); file.AddDepend(hname.c_str());
this->WrapClasses.push_back(file); this->WrapClasses.push_back(file);
if (sourceListValue.size() > 0) if (sourceListValue.size() > 0)
{ {

View File

@ -86,10 +86,10 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn)
std::string hname = header_file.GetFullPath(); std::string hname = header_file.GetFullPath();
this->WrapUserInterface.push_back(origname); this->WrapUserInterface.push_back(origname);
// add starting depends // add starting depends
moc_file.GetDepends().push_back(hname); moc_file.AddDepend(hname.c_str());
source_file.GetDepends().push_back(hname); source_file.AddDepend(hname.c_str());
source_file.GetDepends().push_back(origname); source_file.AddDepend(origname.c_str());
header_file.GetDepends().push_back(origname); header_file.AddDepend(origname.c_str());
this->WrapHeadersClasses.push_back(header_file); this->WrapHeadersClasses.push_back(header_file);
this->WrapSourcesClasses.push_back(source_file); this->WrapSourcesClasses.push_back(source_file);
this->WrapMocClasses.push_back(moc_file); this->WrapMocClasses.push_back(moc_file);

View File

@ -102,7 +102,7 @@ public:
* Return the vector that holds the list of dependencies * Return the vector that holds the list of dependencies
*/ */
const std::vector<std::string> &GetDepends() const {return this->Depends;} const std::vector<std::string> &GetDepends() const {return this->Depends;}
std::vector<std::string> &GetDepends() {return this->Depends;} void AddDepend(const char* d) { this->Depends.push_back(d); }
/** /**
* Get the source name without last extension * Get the source name without last extension