From 463b3f03bd848a345ab535d31be31d395fe66b13 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 11 Aug 2009 09:07:42 -0400 Subject: 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. --- Source/cmTarget.cxx | 12 +++++++++--- Source/cmTarget.h | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8fdb16a..4885b07 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1023,6 +1023,14 @@ bool cmTarget::IsLinkable() } //---------------------------------------------------------------------------- +bool cmTarget::HasImportLibrary() +{ + return (this->DLLPlatform && + (this->GetType() == cmTarget::SHARED_LIBRARY || + this->IsExecutableWithExports())); +} + +//---------------------------------------------------------------------------- bool cmTarget::IsFrameworkOnApple() { return (this->GetType() == cmTarget::SHARED_LIBRARY && @@ -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 // library or an executable with exports. - bool allowImp = - this->DLLPlatform && (this->GetType() == cmTarget::SHARED_LIBRARY || - this->IsExecutableWithExports()); + bool allowImp = this->HasImportLibrary(); // Look for a mapping from the current project's configuration to // the imported project's configuration. diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 015a3a6..e0118fc 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -413,6 +413,12 @@ public: /** Return whether this target may be used to link another target. */ 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 Apple. */ bool IsFrameworkOnApple(); -- cgit v0.12