cmGeneratorTarget: Move IsDLLPlatform from cmTarget.

This commit is contained in:
Stephen Kelly 2015-10-20 00:44:15 +02:00
parent 3ebc62850c
commit 6d94078e62
4 changed files with 16 additions and 6 deletions

View File

@ -1579,7 +1579,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
const GeneratorExpressionContent *content) const GeneratorExpressionContent *content)
{ {
// The target soname file (.so.1). // The target soname file (.so.1).
if(target->Target->IsDLLPlatform()) if(target->IsDLLPlatform())
{ {
::reportError(context, content->GetOriginalExpression(), ::reportError(context, content->GetOriginalExpression(),
"TARGET_SONAME_FILE is not allowed " "TARGET_SONAME_FILE is not allowed "

View File

@ -304,6 +304,10 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
t->GetSourceEntries(), t->GetSourceEntries(),
t->GetSourceBacktraces(), t->GetSourceBacktraces(),
this->SourceEntries, true); this->SourceEntries, true);
this->DLLPlatform = (this->Makefile->IsOn("WIN32") ||
this->Makefile->IsOn("CYGWIN") ||
this->Makefile->IsOn("MINGW"));
} }
cmGeneratorTarget::~cmGeneratorTarget() cmGeneratorTarget::~cmGeneratorTarget()
@ -366,7 +370,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
switch(this->GetType()) switch(this->GetType())
{ {
case cmState::SHARED_LIBRARY: case cmState::SHARED_LIBRARY:
if(this->Target->IsDLLPlatform()) if(this->IsDLLPlatform())
{ {
if(implib) if(implib)
{ {
@ -2058,6 +2062,11 @@ cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
return data; return data;
} }
bool cmGeneratorTarget::IsDLLPlatform() const
{
return this->DLLPlatform;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs, cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
@ -5964,7 +5973,7 @@ bool cmGeneratorTarget::IsExecutableWithExports() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGeneratorTarget::HasImportLibrary() const bool cmGeneratorTarget::HasImportLibrary() const
{ {
return (this->Target->IsDLLPlatform() && return (this->IsDLLPlatform() &&
(this->GetType() == cmState::SHARED_LIBRARY || (this->GetType() == cmState::SHARED_LIBRARY ||
this->IsExecutableWithExports())); this->IsExecutableWithExports()));
} }

View File

@ -196,6 +196,9 @@ public:
std::string GetModuleDefinitionFile(const std::string& config) const; std::string GetModuleDefinitionFile(const std::string& config) const;
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() const;
/** @return whether this target have a well defined output file name. */ /** @return whether this target have a well defined output file name. */
bool HaveWellDefinedOutputFiles() const; bool HaveWellDefinedOutputFiles() const;
@ -646,6 +649,7 @@ private:
mutable bool DebugSourcesDone; mutable bool DebugSourcesDone;
mutable bool LinkImplementationLanguageIsContextDependent; mutable bool LinkImplementationLanguageIsContextDependent;
mutable bool UtilityItemsDone; mutable bool UtilityItemsDone;
bool DLLPlatform;
bool ComputePDBOutputDir(const std::string& kind, const std::string& config, bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const; std::string& out) const;

View File

@ -224,9 +224,6 @@ public:
enabled. */ enabled. */
bool IsExecutableWithExports() const; bool IsExecutableWithExports() const;
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() const { return this->DLLPlatform; }
/** Return whether this target is a shared library Framework on /** Return whether this target is a shared library Framework on
Apple. */ Apple. */
bool IsFrameworkOnApple() const; bool IsFrameworkOnApple() const;