| 1185 | } |
| 1186 | |
| 1187 | bool HandleRPathCheckCommand(std::vector<std::string> const& args, |
| 1188 | cmExecutionStatus& status) |
| 1189 | { |
| 1190 | // Evaluate arguments. |
| 1191 | std::string file; |
| 1192 | cm::optional<std::string> rpath; |
| 1193 | cmArgumentParser<void> parser; |
| 1194 | std::vector<std::string> unknownArgs; |
| 1195 | parser.Bind("FILE"_s, file).Bind("RPATH"_s, rpath); |
| 1196 | ArgumentParser::ParseResult parseResult = |
| 1197 | parser.Parse(cmMakeRange(args).advance(1), &unknownArgs); |
| 1198 | if (!unknownArgs.empty()) { |
| 1199 | status.SetError( |
| 1200 | cmStrCat("RPATH_CHECK given unknown argument ", unknownArgs.front())); |
| 1201 | return false; |
| 1202 | } |
| 1203 | if (parseResult.MaybeReportError(status.GetMakefile())) { |
| 1204 | return true; |
| 1205 | } |
| 1206 | if (file.empty()) { |
| 1207 | status.SetError("RPATH_CHECK not given FILE option."); |
| 1208 | return false; |
| 1209 | } |
| 1210 | if (!rpath) { |
| 1211 | status.SetError("RPATH_CHECK not given RPATH option."); |
| 1212 | return false; |
| 1213 | } |
| 1214 | |
| 1215 | // If the file exists but does not have the desired RPath then |
| 1216 | // delete it. This is used during installation to re-install a file |
| 1217 | // if its RPath will change. |
| 1218 | if (cmSystemTools::FileExists(file, true) && |
| 1219 | !cmSystemTools::CheckRPath(file, *rpath)) { |
| 1220 | cmSystemTools::RemoveFile(file); |
| 1221 | } |
| 1222 | |
| 1223 | return true; |
| 1224 | } |
| 1225 | |
| 1226 | bool HandleReadElfCommand(std::vector<std::string> const& args, |
| 1227 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…