summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-07 23:01:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-12 16:39:58 (GMT)
commit9ca4cae51e8fb67e628fe7b41eea3f459f148237 (patch)
tree6b0e7b37b6b316be6a0ad23268b7430bf2854434 /Source
parentd6b394edcb58752cfa3d2a34a81f558676781304 (diff)
downloadCMake-9ca4cae51e8fb67e628fe7b41eea3f459f148237.zip
CMake-9ca4cae51e8fb67e628fe7b41eea3f459f148237.tar.gz
CMake-9ca4cae51e8fb67e628fe7b41eea3f459f148237.tar.bz2
cmGeneratorTarget: Move GetUtilityItems from cmTarget.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkDepends.h1
-rw-r--r--Source/cmComputeTargetDepends.cxx4
-rw-r--r--Source/cmGeneratorTarget.cxx21
-rw-r--r--Source/cmGeneratorTarget.h4
-rw-r--r--Source/cmTarget.cxx21
-rw-r--r--Source/cmTarget.h2
6 files changed, 26 insertions, 27 deletions
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index cd067f5..33ba0b8 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -14,6 +14,7 @@
#include "cmStandardIncludes.h"
#include "cmTarget.h"
+#include "cmLinkItem.h"
#include "cmGraphAdjacencyList.h"
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 18aad10..e53b7b9 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -272,7 +272,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// Loop over all utility dependencies.
{
- std::set<cmLinkItem> const& tutils = depender->Target->GetUtilityItems();
+ std::set<cmLinkItem> const& tutils = depender->GetUtilityItems();
std::set<std::string> emitted;
// A target should not depend on itself.
emitted.insert(depender->GetName());
@@ -426,7 +426,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
{
// Skip IMPORTED and INTERFACE targets but follow their utility
// dependencies.
- std::set<cmLinkItem> const& utils = dependee->Target->GetUtilityItems();
+ std::set<cmLinkItem> const& utils = dependee->GetUtilityItems();
for(std::set<cmLinkItem>::const_iterator i = utils.begin();
i != utils.end(); ++i)
{
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 96bacdf..d56559a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -271,7 +271,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
DebugCompileFeaturesDone(false),
DebugCompileDefinitionsDone(false),
DebugSourcesDone(false),
- LinkImplementationLanguageIsContextDependent(true)
+ LinkImplementationLanguageIsContextDependent(true),
+ UtilityItemsDone(false)
{
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg;
@@ -760,7 +761,23 @@ cmGeneratorTarget::GetExpectedXamlSources(std::set<std::string>& srcs,
{
XamlData data;
IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
- srcs = data.ExpectedXamlSources;
+ srcs = data.ExpectedXamlSources;
+}
+
+std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
+{
+ if(!this->UtilityItemsDone)
+ {
+ this->UtilityItemsDone = true;
+ std::set<std::string> const& utilities = this->Target->GetUtilities();
+ for(std::set<std::string>::const_iterator i = utilities.begin();
+ i != utilities.end(); ++i)
+ {
+ this->UtilityItems.insert(
+ cmLinkItem(*i, this->Makefile->FindTargetToUse(*i)));
+ }
+ }
+ return this->UtilityItems;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 799110c..70612f2 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -82,6 +82,8 @@ public:
void GetExpectedXamlSources(std::set<std::string>&,
const std::string& config) const;
+ std::set<cmLinkItem>const& GetUtilityItems() const;
+
void ComputeObjectMapping();
const char* GetFeature(const std::string& feature,
@@ -537,6 +539,7 @@ private:
typedef std::pair<std::string, bool> OutputNameKey;
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
mutable OutputNameMapType OutputNameMap;
+ mutable std::set<cmLinkItem> UtilityItems;
mutable bool PolicyWarnedCMP0022;
mutable bool DebugIncludesDone;
mutable bool DebugCompileOptionsDone;
@@ -544,6 +547,7 @@ private:
mutable bool DebugCompileDefinitionsDone;
mutable bool DebugSourcesDone;
mutable bool LinkImplementationLanguageIsContextDependent;
+ mutable bool UtilityItemsDone;
bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3de7efe..31a9aa7 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -67,12 +67,10 @@ public:
cmTargetInternals()
: Backtrace()
{
- this->UtilityItemsDone = false;
}
cmTargetInternals(cmTargetInternals const&)
: Backtrace()
{
- this->UtilityItemsDone = false;
}
~cmTargetInternals();
@@ -82,9 +80,6 @@ public:
typedef std::map<std::string, cmTarget::ImportInfo> ImportInfoMapType;
ImportInfoMapType ImportInfoMap;
- std::set<cmLinkItem> UtilityItems;
- bool UtilityItemsDone;
-
std::vector<std::string> IncludeDirectoriesEntries;
std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
std::vector<std::string> CompileOptionsEntries;
@@ -364,22 +359,6 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(
}
//----------------------------------------------------------------------------
-std::set<cmLinkItem> const& cmTarget::GetUtilityItems() const
-{
- if(!this->Internal->UtilityItemsDone)
- {
- this->Internal->UtilityItemsDone = true;
- for(std::set<std::string>::const_iterator i = this->Utilities.begin();
- i != this->Utilities.end(); ++i)
- {
- this->Internal->UtilityItems.insert(
- cmLinkItem(*i, this->Makefile->FindTargetToUse(*i)));
- }
- }
- return this->Internal->UtilityItems;
-}
-
-//----------------------------------------------------------------------------
void cmTarget::FinishConfigure()
{
// Erase any cached link information that might have been comptued
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 16d0121..0c1bbd2 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -16,7 +16,6 @@
#include "cmPropertyMap.h"
#include "cmPolicies.h"
#include "cmListFileCache.h"
-#include "cmLinkItem.h"
#include <cmsys/auto_ptr.hxx>
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -206,7 +205,6 @@ public:
void AddUtility(const std::string& u, cmMakefile *makefile = 0);
///! Get the utilities used by this target
std::set<std::string>const& GetUtilities() const { return this->Utilities; }
- std::set<cmLinkItem>const& GetUtilityItems() const;
cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
/** Finalize the target at the end of the Configure step. */