diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-08 10:21:38 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-10 18:38:59 (GMT) |
commit | 77c4202edc242c96087295585a85a20700bdb26f (patch) | |
tree | fd0c780e1e758ed43e5b2958cd467cca9ad78c7a /Source/cmLocalGenerator.cxx | |
parent | 09b6cc66b09b9689ca01faee5e33ef101b46f972 (diff) | |
download | CMake-77c4202edc242c96087295585a85a20700bdb26f.zip CMake-77c4202edc242c96087295585a85a20700bdb26f.tar.gz CMake-77c4202edc242c96087295585a85a20700bdb26f.tar.bz2 |
cmLinkLineComputer: Move RPath computation from cmLocalGenerator
Add state for Relink and populate it at the point of cmLinkLineComputer
initialization. This allows removal of the parameter in go-between
methods.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ab3d3b6..63c8aef 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1208,7 +1208,7 @@ void cmLocalGenerator::GetTargetFlags( } if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, - frameworkPath, linkPath, false, false, + frameworkPath, linkPath, false, useWatcomQuote); } } break; @@ -1231,7 +1231,7 @@ void cmLocalGenerator::GetTargetFlags( this->AddLanguageFlags(flags, linkLanguage, buildType); if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, - frameworkPath, linkPath, false, false, + frameworkPath, linkPath, false, useWatcomQuote); } if (cmSystemTools::IsOn( @@ -1400,8 +1400,7 @@ std::string cmLocalGenerator::GetTargetFortranFlags( void cmLocalGenerator::OutputLinkLibraries( cmComputeLinkInformation* pcli, cmLinkLineComputer* linkLineComputer, std::string& linkLibraries, std::string& frameworkPath, - std::string& linkPath, bool relink, bool forResponseFile, - bool useWatcomQuote) + std::string& linkPath, bool forResponseFile, bool useWatcomQuote) { OutputFormat shellFormat = (forResponseFile) ? RESPONSE : ((useWatcomQuote) ? WATCOMQUOTE : SHELL); @@ -1446,31 +1445,7 @@ void cmLocalGenerator::OutputLinkLibraries( std::string linkLibs = linkLineComputer->ComputeLinkLibs(cli); - 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); - - for (std::vector<std::string>::iterator ri = runtimeDirs.begin(); - ri != runtimeDirs.end(); ++ri) { - rpath += cli.GetRuntimeFlag(); - rpath += this->ConvertToOutputFormat(*ri, shellFormat); - rpath += " "; - } - } else { - // All rpath entries are combined ("-Wl,-rpath,a:b:c"). - std::string rpathString = cli.GetRPathString(relink); - - // Store the rpath option in the stream. - if (!rpathString.empty()) { - rpath += cli.GetRuntimeFlag(); - rpath += this->EscapeForShell(rpathString, escapeAllowMakeVars); - rpath += " "; - } - } + std::string rpath = linkLineComputer->ComputeRPath(cli); std::ostringstream fout; fout << rpath; |