cmGeneratorTarget: Move HasImportLibrary from cmTarget.

This commit is contained in:
Stephen Kelly 2015-10-09 23:45:55 +02:00
parent 8d2e3e53b9
commit 526cc7dc52
5 changed files with 17 additions and 6 deletions

View File

@ -1658,7 +1658,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
return std::string();
}
return target->GetFullPath(context->Config,
target->Target->HasImportLibrary());
target->HasImportLibrary());
}
};

View File

@ -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()));
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;