diff options
author | Brad King <brad.king@kitware.com> | 2008-02-11 15:31:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-11 15:31:38 (GMT) |
commit | 7b048433c1d644103f7440dce78d05e4625f1958 (patch) | |
tree | 00d685c9ec8722c2869c712c2b4899991093b0aa /Source | |
parent | 0cdf73f0a2aae3bfa15ea5d11fdfeb85c59520e7 (diff) | |
download | CMake-7b048433c1d644103f7440dce78d05e4625f1958.zip CMake-7b048433c1d644103f7440dce78d05e4625f1958.tar.gz CMake-7b048433c1d644103f7440dce78d05e4625f1958.tar.bz2 |
BUG: Fix cmComputeLinkDepends::AddVarLinkEntries
- Track link type correctly
- Use _LINK_TYPE variables exported by CMake 2.4
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 4ca590b..29164a2 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -410,28 +410,58 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index, // Look for entries meant for this configuration. std::vector<std::string> actual_libs; cmTarget::LinkLibraryType llt = cmTarget::GENERAL; + bool haveLLT = false; for(std::vector<std::string>::const_iterator di = deplist.begin(); di != deplist.end(); ++di) { if(*di == "debug") { llt = cmTarget::DEBUG; + haveLLT = true; } else if(*di == "optimized") { llt = cmTarget::OPTIMIZED; + haveLLT = true; } else if(*di == "general") { llt = cmTarget::GENERAL; + haveLLT = true; } else if(!di->empty()) { + // If no explicit link type was given prior to this entry then + // check if the entry has its own link type variable. This is + // needed for compatibility with dependency files generated by + // the export_library_dependencies command from CMake 2.4 and + // lower. + if(!haveLLT) + { + std::string var = *di; + var += "_LINK_TYPE"; + if(const char* val = this->Makefile->GetDefinition(var.c_str())) + { + if(strcmp(val, "debug") == 0) + { + llt = cmTarget::DEBUG; + } + else if(strcmp(val, "optimized") == 0) + { + llt = cmTarget::OPTIMIZED; + } + } + } + + // If the library is meant for this link type then use it. if(llt == cmTarget::GENERAL || llt == linkType) { actual_libs.push_back(*di); } - linkType = cmTarget::GENERAL; + + // Reset the link type until another explicit type is given. + llt = cmTarget::GENERAL; + haveLLT = false; } } |