From 74d653602413297e00d5507f3839da0acbfd0030 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Jul 2008 12:19:54 -0400 Subject: [PATCH] ENH: Skip libs in known dirs for CMP0003 warnings. Sometimes we ask the linker to search for a library for which the path is known but for some reason cannot be specified by full path. In these cases do not include the library in CMP0003 warnings because we know the extra paths are not needed for it. --- Source/cmComputeLinkInformation.cxx | 14 +++++++++----- Source/cmComputeLinkInformation.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 87157a7e4..9b6837d3b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -637,7 +637,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, cmTarget* tgt) else { // This is a library or option specified by the user. - this->AddUserItem(item); + this->AddUserItem(item, true); } } } @@ -1155,12 +1155,13 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item) // directory then just report the file name without the directory // portion. This will allow the system linker to locate the proper // library for the architecture at link time. - this->AddUserItem(file); + this->AddUserItem(file, false); return true; } //---------------------------------------------------------------------------- -void cmComputeLinkInformation::AddUserItem(std::string const& item) +void cmComputeLinkInformation::AddUserItem(std::string const& item, + bool pathNotKnown) { // This is called to handle a link item that does not match a CMake // target and is not a full path. We check here if it looks like a @@ -1250,7 +1251,10 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item) else { // This is a name specified by the user. - this->OldUserFlagItems.push_back(item); + if(pathNotKnown) + { + this->OldUserFlagItems.push_back(item); + } // We must ask the linker to search for a library with this name. // Restore the target link type since this item does not specify @@ -1373,7 +1377,7 @@ void cmComputeLinkInformation::AddSharedLibNoSOName(std::string const& item) // runtime the dynamic linker will search for the library using the // path instead of just the name. std::string file = cmSystemTools::GetFilenameName(item); - this->AddUserItem(file); + this->AddUserItem(file, false); // Make sure the link directory ordering will find the library. this->OrderLinkerSearchPath->AddLinkLibrary(item); diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 0ac0afc67..c1f240b24 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -139,7 +139,7 @@ private: void AddTargetItem(std::string const& item, cmTarget* target); void AddFullItem(std::string const& item); bool CheckImplicitDirItem(std::string const& item); - void AddUserItem(std::string const& item); + void AddUserItem(std::string const& item, bool pathNotKnown); void AddDirectoryItem(std::string const& item); void AddFrameworkItem(std::string const& item); void DropDirectoryItem(std::string const& item);