summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-09 21:45:55 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-12 16:39:59 (GMT)
commit526cc7dc52673f1eeb1055ce381e0551f763daea (patch)
treedb90d5ce3d8b6cbef17be99d5773208d90d5c95a
parent8d2e3e53b903b1ee38292b6bcdf3e4eeb5399a05 (diff)
downloadCMake-526cc7dc52673f1eeb1055ce381e0551f763daea.zip
CMake-526cc7dc52673f1eeb1055ce381e0551f763daea.tar.gz
CMake-526cc7dc52673f1eeb1055ce381e0551f763daea.tar.bz2
cmGeneratorTarget: Move HasImportLibrary from cmTarget.
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmGeneratorTarget.h3
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.h6
5 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 7e47261..2d9025e 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1658,7 +1658,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
return std::string();
}
return target->GetFullPath(context->Config,
- target->Target->HasImportLibrary());
+ target->HasImportLibrary());
}
};
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 90acca6..582282b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5487,7 +5487,7 @@ cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
//----------------------------------------------------------------------------
bool cmGeneratorTarget::HasImplibGNUtoMS() const
{
- return this->Target->HasImportLibrary()
+ return this->HasImportLibrary()
&& this->GetPropertyAsBool("GNUtoMS");
}
@@ -5504,3 +5504,11 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName,
}
return false;
}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::HasImportLibrary() const
+{
+ return (this->Target->IsDLLPlatform() &&
+ (this->GetType() == cmTarget::SHARED_LIBRARY ||
+ this->Target->IsExecutableWithExports()));
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e2be249..c6e56bf 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -398,6 +398,9 @@ public:
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
const char* newExt = 0) const;
+ /** Return whether or not the target has a DLL import library. */
+ bool HasImportLibrary() const;
+
struct SourceFileFlags
GetTargetSourceFileFlags(const cmSourceFile* sf) const;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2a6c414..874a120 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -559,7 +559,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmLocalGenerator::SHELL);
vars["TARGET_IMPLIB"] = impLibPath;
EnsureParentDirectoryExists(impLibPath);
- if(target.HasImportLibrary())
+ if(genTarget.HasImportLibrary())
{
byproducts.push_back(targetOutputImplib);
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 500b598..291ef87 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -262,9 +262,6 @@ public:
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() const { return this->DLLPlatform; }
- /** Return whether or not the target has a DLL import library. */
- bool HasImportLibrary() const;
-
/** Return whether this target is a shared library Framework on
Apple. */
bool IsFrameworkOnApple() const;
@@ -463,6 +460,9 @@ private:
void MaybeInvalidatePropertyCache(const std::string& prop);
+ /** Return whether or not the target has a DLL import library. */
+ bool HasImportLibrary() const;
+
// Internal representation details.
friend class cmTargetInternals;
friend class cmGeneratorTarget;