summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-08 10:21:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-10 18:38:55 (GMT)
commit80f57e67eefc905a726f2f35bd1672a188ea4c99 (patch)
treee2f9744544bfb44fa9e0be843c467e6290d18534 /Source/cmLocalGenerator.cxx
parent7ef834682547df5e0ccdcd503558dcbf1206a638 (diff)
downloadCMake-80f57e67eefc905a726f2f35bd1672a188ea4c99.zip
CMake-80f57e67eefc905a726f2f35bd1672a188ea4c99.tar.gz
CMake-80f57e67eefc905a726f2f35bd1672a188ea4c99.tar.bz2
cmLocalGenerator: Separate rpath content from library stream
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ae4a0b2..6de8f9a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1463,32 +1463,34 @@ void cmLocalGenerator::OutputLinkLibraries(
linkLibs += " ";
}
+ std::string rpath;
+
// Check what kind of rpath flags to use.
if (cli.GetRuntimeSep().empty()) {
// Each rpath entry gets its own option ("-R a -R b -R c")
std::vector<std::string> runtimeDirs;
cli.GetRPath(runtimeDirs, relink);
- std::string rpath;
for (std::vector<std::string>::iterator ri = runtimeDirs.begin();
ri != runtimeDirs.end(); ++ri) {
rpath += cli.GetRuntimeFlag();
rpath += this->ConvertToOutputFormat(*ri, shellFormat);
rpath += " ";
}
- fout << rpath;
} else {
// All rpath entries are combined ("-Wl,-rpath,a:b:c").
- std::string rpath = cli.GetRPathString(relink);
+ std::string rpathString = cli.GetRPathString(relink);
// Store the rpath option in the stream.
- if (!rpath.empty()) {
- fout << cli.GetRuntimeFlag();
- fout << this->EscapeForShell(rpath, escapeAllowMakeVars);
- fout << " ";
+ if (!rpathString.empty()) {
+ rpath += cli.GetRuntimeFlag();
+ rpath += this->EscapeForShell(rpathString, escapeAllowMakeVars);
+ rpath += " ";
}
}
+ fout << rpath;
+
// Write the library flags to the build rule.
fout << linkLibs;