cmGeneratorTarget: Add GetUtilities API

This commit is contained in:
Stephen Kelly 2015-10-23 01:01:46 +02:00
parent f210cb131e
commit 736c2042c6
7 changed files with 14 additions and 8 deletions

View File

@ -796,7 +796,7 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
if(!this->UtilityItemsDone)
{
this->UtilityItemsDone = true;
std::set<std::string> const& utilities = this->Target->GetUtilities();
std::set<std::string> const& utilities = this->GetUtilities();
for(std::set<std::string>::const_iterator i = utilities.begin();
i != utilities.end(); ++i)
{
@ -1737,6 +1737,11 @@ const std::vector<std::string>&cmGeneratorTarget::GetLinkDirectories() const
return this->Target->GetLinkDirectories();
}
const std::set<std::string>& cmGeneratorTarget::GetUtilities() const
{
return this->Target->GetUtilities();
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
{

View File

@ -186,6 +186,7 @@ public:
const std::vector<std::string>& GetLinkDirectories() const;
std::set<std::string>const& GetUtilities() const;
/** Get the macro to define when building sources in this target.
If no macro should be defined null is returned. */
const char* GetExportMacro() const;

View File

@ -965,7 +965,7 @@ cmGlobalNinjaGenerator
if (target->GetType() == cmState::GLOBAL_TARGET) {
// Global targets only depend on other utilities, which may not appear in
// the TargetDepends set (e.g. "all").
std::set<std::string> const& utils = target->Target->GetUtilities();
std::set<std::string> const& utils = target->GetUtilities();
std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
} else {
cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(target);

View File

@ -235,7 +235,7 @@ void cmGlobalVisualStudio6Generator
std::string project = target->GetName();
std::string location = expath;
this->WriteExternalProject(fout, project.c_str(),
location.c_str(), target->Target->GetUtilities());
location.c_str(), target->GetUtilities());
}
else
{

View File

@ -459,7 +459,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
project.c_str(),
location.c_str(),
target->GetProperty("VS_PROJECT_TYPE"),
target->Target->GetUtilities());
target->GetUtilities());
written = true;
}
else

View File

@ -464,8 +464,8 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
{
// Look for utility dependencies that magically link.
for(std::set<std::string>::const_iterator ui =
target->Target->GetUtilities().begin();
ui != target->Target->GetUtilities().end(); ++ui)
target->GetUtilities().begin();
ui != target->GetUtilities().end(); ++ui)
{
if(cmGeneratorTarget* depTarget =
target->GetLocalGenerator()->FindGeneratorTargetToUse(ui->c_str()))

View File

@ -1778,8 +1778,8 @@ void cmLocalUnixMakefileGenerator3
{
text = "Running external command ...";
}
depends.insert(depends.end(), (*glIt)->Target->GetUtilities().begin(),
(*glIt)->Target->GetUtilities().end());
depends.insert(depends.end(), (*glIt)->GetUtilities().begin(),
(*glIt)->GetUtilities().end());
this->AppendEcho(commands, text,
cmLocalUnixMakefileGenerator3::EchoGlobal);