diff options
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index aff9dd9..8d27699 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1798,10 +1798,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, if (use_build_rpath) { std::string d = ri; if (!rootPath.empty() && cmHasPrefix(d, rootPath)) { - d = d.substr(rootPath.size()); + d.erase(0, rootPath.size()); } else if (stagePath && *stagePath && cmHasPrefix(d, stagePath)) { - std::string suffix = d.substr(strlen(stagePath)); - d = cmStrCat(installPrefix, '/', suffix); + d.erase(0, strlen(stagePath)); + d = cmStrCat(installPrefix, '/', d); cmSystemTools::ConvertToUnixSlashes(d); } else if (use_relative_build_rpath) { // If expansion of the $ORIGIN token is supported and permitted per @@ -1829,10 +1829,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, !cmSystemTools::IsSubDirectory(ri, topBinaryDir)) { std::string d = ri; if (!rootPath.empty() && cmHasPrefix(d, rootPath)) { - d = d.substr(rootPath.size()); + d.erase(0, rootPath.size()); } else if (stagePath && *stagePath && cmHasPrefix(d, stagePath)) { - std::string suffix = d.substr(strlen(stagePath)); - d = cmStrCat(installPrefix, '/', suffix); + d.erase(0, strlen(stagePath)); + d = cmStrCat(installPrefix, '/', d); cmSystemTools::ConvertToUnixSlashes(d); } if (emitted.insert(d).second) { |