diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2019-09-11 18:04:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-18 18:00:37 (GMT) |
commit | 7da17ef7973294a5207f879c0c5a3ed7ab727029 (patch) | |
tree | 445f8489269953b90c80f5930bf10a126932abcf /Source/cmLinkLineComputer.cxx | |
parent | d4d0dd0f6a0f2287fd0fbdfad8c7210515af5eaa (diff) | |
download | CMake-7da17ef7973294a5207f879c0c5a3ed7ab727029.zip CMake-7da17ef7973294a5207f879c0c5a3ed7ab727029.tar.gz CMake-7da17ef7973294a5207f879c0c5a3ed7ab727029.tar.bz2 |
cmLinkLineComputer: Add ComputeLinkLibraries overload with backtraces
Diffstat (limited to 'Source/cmLinkLineComputer.cxx')
-rw-r--r-- | Source/cmLinkLineComputer.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index dec25ff..0dc6236 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -222,13 +222,30 @@ std::string cmLinkLineComputer::ComputeFrameworkPath( std::string cmLinkLineComputer::ComputeLinkLibraries( cmComputeLinkInformation& cli, std::string const& stdLibString) { - std::ostringstream fout; - fout << this->ComputeRPath(cli); + std::string linkLibraries; + std::vector<BT<std::string>> linkLibrariesList; + this->ComputeLinkLibraries(cli, stdLibString, linkLibrariesList); + cli.AppendValues(linkLibraries, linkLibrariesList); + return linkLibraries; +} + +void cmLinkLineComputer::ComputeLinkLibraries( + cmComputeLinkInformation& cli, std::string const& stdLibString, + std::vector<BT<std::string>>& linkLibraries) +{ + std::ostringstream rpathOut; + rpathOut << this->ComputeRPath(cli); + + std::string rpath = rpathOut.str(); + if (!rpath.empty()) { + linkLibraries.emplace_back(std::move(rpath)); + } // Write the library flags to the build rule. - fout << this->ComputeLinkLibs(cli); + this->ComputeLinkLibs(cli, linkLibraries); // Add the linker runtime search path if any. + std::ostringstream fout; std::string rpath_link = cli.GetRPathLinkString(); if (!cli.GetRPathLinkFlag().empty() && !rpath_link.empty()) { fout << cli.GetRPathLinkFlag(); @@ -241,7 +258,10 @@ std::string cmLinkLineComputer::ComputeLinkLibraries( fout << stdLibString << " "; } - return fout.str(); + std::string remainingLibs = fout.str(); + if (!remainingLibs.empty()) { + linkLibraries.emplace_back(remainingLibs); + } } std::string cmLinkLineComputer::GetLinkerLanguage(cmGeneratorTarget* target, |