summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-09 21:44:11 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-19 18:27:40 (GMT)
commit8e20ea6ef2258867bd6554536fa7b914f266df96 (patch)
treed999ce9be3f883ce7a4357a8c2b3ccf3b4fd38ef /Source
parenta527abf0995fc1bdd45afdb20e80b728dd0ef045 (diff)
downloadCMake-8e20ea6ef2258867bd6554536fa7b914f266df96.zip
CMake-8e20ea6ef2258867bd6554536fa7b914f266df96.tar.gz
CMake-8e20ea6ef2258867bd6554536fa7b914f266df96.tar.bz2
cmGeneratorTarget: Move IsLinkable from cmTarget.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx11
-rw-r--r--Source/cmGeneratorTarget.h3
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx5
-rw-r--r--Source/cmTarget.cxx11
-rw-r--r--Source/cmTarget.h3
8 files changed, 20 insertions, 19 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 7bdc555..889c55c 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -643,7 +643,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
return;
}
- if(tgt && tgt->Target->IsLinkable())
+ if(tgt && tgt->IsLinkable())
{
// This is a CMake target. Ask the target for its real name.
if(impexe && this->LoaderFlag)
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 3e58400..fdc21db 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -210,7 +210,7 @@ bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets)
{
- if(!target->Target->IsLinkable())
+ if(!target->IsLinkable())
{
return false;
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c7c0e73..1a878e2 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1654,7 +1654,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
const GeneratorExpressionContent *content)
{
// The file used to link to the target (.so, .lib, .a).
- if(!target->Target->IsLinkable())
+ if(!target->IsLinkable())
{
::reportError(context, content->GetOriginalExpression(),
"TARGET_LINKER_FILE is allowed only for libraries and "
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 03c950e..bdf29b2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5936,3 +5936,14 @@ std::string cmGeneratorTarget::GetSupportDirectory() const
#endif
return dir;
}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::IsLinkable() const
+{
+ return (this->GetType() == cmState::STATIC_LIBRARY ||
+ this->GetType() == cmState::SHARED_LIBRARY ||
+ this->GetType() == cmState::MODULE_LIBRARY ||
+ this->GetType() == cmState::UNKNOWN_LIBRARY ||
+ this->GetType() == cmState::INTERFACE_LIBRARY ||
+ this->Target->IsExecutableWithExports());
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 1029158..a4a432c 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -412,6 +412,9 @@ public:
/** Get a build-tree directory in which to place target support files. */
std::string GetSupportDirectory() const;
+ /** Return whether this target may be used to link another target. */
+ bool IsLinkable() const;
+
struct SourceFileFlags
GetTargetSourceFileFlags(const cmSourceFile* sf) const;
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index d81d3b8..9af5b35 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -385,7 +385,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
}
//----------------------------------------------------------------------------
-static bool VSLinkable(cmTarget const* t)
+static bool VSLinkable(cmGeneratorTarget const* t)
{
return t->IsLinkable() || t->GetType() == cmState::OBJECT_LIBRARY;
}
@@ -475,7 +475,8 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
di != utilDepends.end(); ++di)
{
cmTarget const* dep = *di;
- if(allowLinkable || !VSLinkable(dep) || linked.count(dep))
+ cmGeneratorTarget* dgt = this->GetGeneratorTarget(dep);
+ if(allowLinkable || !VSLinkable(dgt) || linked.count(dep))
{
// Direct dependency allowed.
vsTargetDepend.insert(dep->GetName());
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 57a2d24..761267d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -345,17 +345,6 @@ bool cmTarget::IsExecutableWithExports() const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsLinkable() const
-{
- return (this->GetType() == cmState::STATIC_LIBRARY ||
- this->GetType() == cmState::SHARED_LIBRARY ||
- this->GetType() == cmState::MODULE_LIBRARY ||
- this->GetType() == cmState::UNKNOWN_LIBRARY ||
- this->GetType() == cmState::INTERFACE_LIBRARY ||
- this->IsExecutableWithExports());
-}
-
-//----------------------------------------------------------------------------
bool cmTarget::HasImportLibrary() const
{
return (this->DLLPlatform &&
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dafe86a..51e97fd 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -228,9 +228,6 @@ public:
enabled. */
bool IsExecutableWithExports() const;
- /** Return whether this target may be used to link another target. */
- bool IsLinkable() const;
-
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() const { return this->DLLPlatform; }