mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 04:29:52 +00:00
ENH: Made cmTarget::GetSourceLists return a reference to const so that all additions of sources must go through access methods in cmTarget.
This commit is contained in:
parent
00c9964a8c
commit
d2f62e6ac3
@ -123,7 +123,7 @@ void cmFLTKWrapUICommand::FinalPass()
|
||||
// people should add the srcs to the target themselves, but the old command
|
||||
// didn't support that, so check and see if they added the files in and if
|
||||
// they didn;t then print a warning and add then anyhow
|
||||
std::vector<std::string> srcs =
|
||||
std::vector<std::string> const& srcs =
|
||||
this->Makefile->GetTargets()[this->Target].GetSourceLists();
|
||||
bool found = false;
|
||||
for (unsigned int i = 0; i < srcs.size(); ++i)
|
||||
|
@ -766,7 +766,7 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
|
||||
{
|
||||
if (this->Targets.find(target) != this->Targets.end())
|
||||
{
|
||||
this->Targets[target].GetSourceLists().push_back(source);
|
||||
this->Targets[target].AddSourceListEntry(source);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -848,7 +848,7 @@ void cmMakefile::AddUtilityCommand(const char* utilityName,
|
||||
commandLines, comment,
|
||||
workingDirectory, no_replace,
|
||||
escapeOldStyle);
|
||||
target->GetSourceLists().push_back(force);
|
||||
target->AddSourceListEntry(force.c_str());
|
||||
|
||||
// The output is not actually created so mark it symbolic.
|
||||
if(cmSourceFile* sf = this->GetSource(force.c_str()))
|
||||
@ -1358,7 +1358,7 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
|
||||
{
|
||||
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
|
||||
}
|
||||
target->GetSourceLists() = srcs;
|
||||
target->SetSourceList(srcs);
|
||||
this->AddGlobalLinkInformation(lname, *target);
|
||||
}
|
||||
|
||||
@ -1371,7 +1371,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName,
|
||||
{
|
||||
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
|
||||
}
|
||||
target->GetSourceLists() = srcs;
|
||||
target->SetSourceList(srcs);
|
||||
this->AddGlobalLinkInformation(exeName, *target);
|
||||
return target;
|
||||
}
|
||||
|
@ -76,7 +76,12 @@ public:
|
||||
/**
|
||||
* Get the list of the source lists used by this target
|
||||
*/
|
||||
std::vector<std::string> &GetSourceLists() {return this->SourceLists;}
|
||||
std::vector<std::string> const& GetSourceLists() {return this->SourceLists;}
|
||||
|
||||
void AddSourceListEntry(const char* src)
|
||||
{ this->SourceLists.push_back(src); }
|
||||
void SetSourceList(std::vector<std::string> const& srcs)
|
||||
{ this->SourceLists = srcs; }
|
||||
|
||||
///! Return the list of frameworks being linked to this target
|
||||
std::vector<std::string> &GetFrameworks() {return this->Frameworks;}
|
||||
|
Loading…
Reference in New Issue
Block a user