summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-12-02 16:45:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-12-02 16:45:38 (GMT)
commit57349a48512c12071f8227b6738401525b3f7e13 (patch)
tree29aaae0354cf407ff564c966aebbee9d7e00fa88 /Source/cmSystemTools.cxx
parentec55e0abc1c7beefab89a6e13125d516848e734b (diff)
parent643fc46bdc13dd57584d5d77eee30a99308ba896 (diff)
downloadCMake-57349a48512c12071f8227b6738401525b3f7e13.zip
CMake-57349a48512c12071f8227b6738401525b3f7e13.tar.gz
CMake-57349a48512c12071f8227b6738401525b3f7e13.tar.bz2
Merge topic 'rpath-unrecognized-format'
643fc46bdc file(RPATH): Restore tolerance of unknown formats if new RPATH is empty 5596cba7dc cmSystemTools: Remove unnecessary mark-as-used casts to void Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6779
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 3699be3..effb837 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2855,6 +2855,14 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
file, oldRPath, newRPath, removeEnvironmentRPath, emsg, changed)) {
return result.value();
}
+ // The file format is not recognized. Assume it has no RPATH.
+ if (newRPath.empty()) {
+ // The caller wanted no RPATH anyway.
+ return true;
+ }
+ if (emsg) {
+ *emsg = "The file format is not recognized.";
+ }
return false;
}
@@ -2869,6 +2877,14 @@ bool cmSystemTools::SetRPath(std::string const& file,
SetRPathXCOFF(file, newRPath, emsg, changed)) {
return result.value();
}
+ // The file format is not recognized. Assume it has no RPATH.
+ if (newRPath.empty()) {
+ // The caller wanted no RPATH anyway.
+ return true;
+ }
+ if (emsg) {
+ *emsg = "The file format is not recognized.";
+ }
return false;
}
@@ -3198,7 +3214,8 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
if (cm::optional<bool> result = RemoveRPathXCOFF(file, emsg, removed)) {
return result.value();
}
- return false;
+ // The file format is not recognized. Assume it has no RPATH.
+ return true;
}
bool cmSystemTools::CheckRPath(std::string const& file,
@@ -3238,9 +3255,9 @@ bool cmSystemTools::CheckRPath(std::string const& file,
return false;
}
#endif
- (void)file;
- (void)newRPath;
- return false;
+ // The file format is not recognized. Assume it has no RPATH.
+ // Therefore we succeed if the new rpath is empty anyway.
+ return newRPath.empty();
}
bool cmSystemTools::RepeatedRemoveDirectory(const std::string& dir)