diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-08-04 18:34:53 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-08-04 18:34:53 (GMT) |
commit | 333562e8cc425ed98354dad604d834c31b1c6575 (patch) | |
tree | bae6d6122a7b48c41a00586a5e688cc702d62746 | |
parent | 867f88a93f1b4c8f85e26c251f7f30de12595019 (diff) | |
download | CMake-333562e8cc425ed98354dad604d834c31b1c6575.zip CMake-333562e8cc425ed98354dad604d834c31b1c6575.tar.gz CMake-333562e8cc425ed98354dad604d834c31b1c6575.tar.bz2 |
fix for debug libs on UNIX
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 3f0b87d..cb82397 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -498,6 +498,9 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, std::string runtimeSep; std::vector<std::string> runtimeDirs; + std::string buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE"); + buildType = cmSystemTools::UpperCase(buildType); + bool cxx = tgt.HasCxx(); if(!cxx ) { @@ -577,8 +580,15 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, { // Don't link the library against itself! if(targetLibrary && (lib->first == targetLibrary)) continue; - // don't look at debug libraries - if (lib->second == cmTarget::DEBUG) continue; + // use the correct lib for the current configuration + if (lib->second == cmTarget::DEBUG && buildType != "DEBUG") + { + continue; + } + if (lib->second == cmTarget::OPTIMIZED && buildType == "DEBUG") + { + continue; + } // skip zero size library entries, this may happen // if a variable expands to nothing. if (lib->first.size() == 0) continue; |