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.
This commit is contained in:
Brad King 2008-07-23 12:19:54 -04:00
parent 363727f600
commit 74d6536024
2 changed files with 10 additions and 6 deletions

View File

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

View File

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