summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-11 18:57:47 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-11 18:57:47 (GMT)
commit0d31c3aafb2db4d40b5ed96a3b47f431c9bb9e77 (patch)
tree4789e6214f0dd92baeb0586f1b602b08af989289 /Source/cmComputeLinkInformation.cxx
parent3615950f124063198a1825d1daaca0cd91c4d3d9 (diff)
downloadCMake-0d31c3aafb2db4d40b5ed96a3b47f431c9bb9e77.zip
CMake-0d31c3aafb2db4d40b5ed96a3b47f431c9bb9e77.tar.gz
CMake-0d31c3aafb2db4d40b5ed96a3b47f431c9bb9e77.tar.bz2
BUG: Do not create empty build-tree RPATH
The fix for issue #9130 appends ':' to the end of the build-tree RPATH unconditionally. This changes the fix to add ':' only when the RPATH is not empty so that we do not create a build-tree RPATH with just ':'. An empty RPATH produces no string at all, so there is no chance of merging with a symbol name anyway.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index cd3ca57..03b8571 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1708,10 +1708,13 @@ std::string cmComputeLinkInformation::GetRPathString(bool for_install)
// If the rpath will be replaced at install time, prepare space.
if(!for_install && this->RuntimeUseChrpath)
{
- // Always add one trailing separator so the linker does not re-use
- // the rpath .dynstr entry for a symbol name that happens to match
- // the end of the rpath string.
- rpath += this->GetRuntimeSep();
+ if(!rpath.empty())
+ {
+ // Add one trailing separator so the linker does not re-use the
+ // rpath .dynstr entry for a symbol name that happens to match
+ // the end of the rpath string.
+ rpath += this->GetRuntimeSep();
+ }
// Make sure it is long enough to hold the replacement value.
std::string::size_type minLength = this->GetChrpathString().length();