Create cmTarget DLL query methods
We creates methods IsDLLPlatform() and HasImportLibrary(). The former returns true on Windows. The latter returns whether the target has a DLL import library. It is true on Windows for shared libraries and executables with exports.
This commit is contained in:
parent
0bc050677f
commit
463b3f03bd
|
@ -1022,6 +1022,14 @@ bool cmTarget::IsLinkable()
|
||||||
this->IsExecutableWithExports());
|
this->IsExecutableWithExports());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool cmTarget::HasImportLibrary()
|
||||||
|
{
|
||||||
|
return (this->DLLPlatform &&
|
||||||
|
(this->GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
|
this->IsExecutableWithExports()));
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmTarget::IsFrameworkOnApple()
|
bool cmTarget::IsFrameworkOnApple()
|
||||||
{
|
{
|
||||||
|
@ -3635,9 +3643,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
|
||||||
|
|
||||||
// On a DLL platform there may be only IMPORTED_IMPLIB for a shared
|
// On a DLL platform there may be only IMPORTED_IMPLIB for a shared
|
||||||
// library or an executable with exports.
|
// library or an executable with exports.
|
||||||
bool allowImp =
|
bool allowImp = this->HasImportLibrary();
|
||||||
this->DLLPlatform && (this->GetType() == cmTarget::SHARED_LIBRARY ||
|
|
||||||
this->IsExecutableWithExports());
|
|
||||||
|
|
||||||
// Look for a mapping from the current project's configuration to
|
// Look for a mapping from the current project's configuration to
|
||||||
// the imported project's configuration.
|
// the imported project's configuration.
|
||||||
|
|
|
@ -413,6 +413,12 @@ public:
|
||||||
/** Return whether this target may be used to link another target. */
|
/** Return whether this target may be used to link another target. */
|
||||||
bool IsLinkable();
|
bool IsLinkable();
|
||||||
|
|
||||||
|
/** Return whether or not the target is for a DLL platform. */
|
||||||
|
bool IsDLLPlatform() { return this->DLLPlatform; }
|
||||||
|
|
||||||
|
/** Return whether or not the target has a DLL import library. */
|
||||||
|
bool HasImportLibrary();
|
||||||
|
|
||||||
/** Return whether this target is a shared library Framework on
|
/** Return whether this target is a shared library Framework on
|
||||||
Apple. */
|
Apple. */
|
||||||
bool IsFrameworkOnApple();
|
bool IsFrameworkOnApple();
|
||||||
|
|
Loading…
Reference in New Issue