ENH: fix for when a library is tagged both debug and optimized

This commit is contained in:
Bill Hoffman 2006-11-20 13:57:12 -05:00
parent a5fc448bda
commit 2852600648
1 changed files with 7 additions and 2 deletions

View File

@ -954,11 +954,16 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
} }
} }
} }
// make sure the tpye is correct // make sure the type is correct if it is currently
// general. So if you do a
// target_link_libraries(foo optimized bar) it will stay
// optimized and not use the lookup. As there maybe the
// case where someone has specifed that a library is both
// debug and optimized.
std::string linkType = lib; std::string linkType = lib;
linkType += "_LINK_TYPE"; linkType += "_LINK_TYPE";
const char* linkTypeString = this->GetDefinition( linkType.c_str() ); const char* linkTypeString = this->GetDefinition( linkType.c_str() );
if(linkTypeString) if(llt == cmTarget::GENERAL && linkTypeString)
{ {
if(strcmp(linkTypeString, "debug") == 0) if(strcmp(linkTypeString, "debug") == 0)
{ {