summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-22 14:13:04 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-22 14:13:04 (GMT)
commit96fd5909d9dd1ffe740230ce652d574cd01c62d5 (patch)
treee83b3ce2d5066660256a69cacb6caa7d2d95c416 /Source/cmLocalVisualStudio6Generator.cxx
parent0df9e6904cd2416336a85d6d7972ce84dcbab417 (diff)
downloadCMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.zip
CMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.tar.gz
CMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.tar.bz2
ENH: Implement linking with paths to library files instead of -L and -l separation. See bug #3832
- This is purely an implementation improvement. No interface has changed. - Create cmComputeLinkInformation class - Move and re-implement logic from: cmLocalGenerator::ComputeLinkInformation cmOrderLinkDirectories - Link libraries to targets with their full path (if it is known) - Dirs specified with link_directories command still added with -L - Make link type specific to library names without paths (name libfoo.a without path becomes -Wl,-Bstatic -lfoo) - Make directory ordering specific to a runtime path computation feature (look for conflicting SONAMEs instead of library names) - Implement proper rpath support on HP-UX and AIX.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx27
1 files changed, 21 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 2cfcf70..b462cd3 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -22,6 +22,8 @@
#include "cmCacheManager.h"
#include "cmake.h"
+#include "cmComputeLinkInformation.h"
+
#include <cmsys/RegularExpression.hxx>
cmLocalVisualStudio6Generator::cmLocalVisualStudio6Generator()
@@ -1569,12 +1571,17 @@ void cmLocalVisualStudio6Generator
std::string& options)
{
// Compute the link information for this configuration.
- std::vector<cmStdString> linkLibs;
- std::vector<cmStdString> linkDirs;
- this->ComputeLinkInformation(target, configName, linkLibs, linkDirs);
+ cmComputeLinkInformation cli(&target, configName);
+ if(!cli.Compute())
+ {
+ return;
+ }
+ typedef cmComputeLinkInformation::ItemVector ItemVector;
+ ItemVector const& linkLibs = cli.GetItems();
+ std::vector<std::string> const& linkDirs = cli.GetDirectories();
// Build the link options code.
- for(std::vector<cmStdString>::const_iterator d = linkDirs.begin();
+ for(std::vector<std::string>::const_iterator d = linkDirs.begin();
d != linkDirs.end(); ++d)
{
std::string dir = *d;
@@ -1592,11 +1599,19 @@ void cmLocalVisualStudio6Generator
options += "\n";
}
}
- for(std::vector<cmStdString>::const_iterator l = linkLibs.begin();
+ for(ItemVector::const_iterator l = linkLibs.begin();
l != linkLibs.end(); ++l)
{
options += "# ADD LINK32 ";
- options += this->ConvertToOptionallyRelativeOutputPath(l->c_str());
+ if(l->IsPath)
+ {
+ options +=
+ this->ConvertToOptionallyRelativeOutputPath(l->Value.c_str());
+ }
+ else
+ {
+ options += l->Value;
+ }
options += "\n";
}