cmFileCommand: improve error message

Print full list of unresolved dependencies and a phrase that indicates
what about the file is unresolved.
This commit is contained in:
Seth R Johnson
2021-10-10 06:31:42 -04:00
committed by Brad King
parent 7257539e67
commit fc92d6640b
5 changed files with 18 additions and 7 deletions

View File

@@ -3170,9 +3170,12 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args,
archive.GetUnresolvedPaths().begin(), archive.GetUnresolvedPaths().begin(),
archive.GetUnresolvedPaths().end()); archive.GetUnresolvedPaths().end());
} else { } else {
auto it = archive.GetUnresolvedPaths().begin(); std::ostringstream e;
assert(it != archive.GetUnresolvedPaths().end()); e << "Could not resolve runtime dependencies:";
status.SetError(cmStrCat("Could not resolve file ", *it)); for (auto const& path : archive.GetUnresolvedPaths()) {
e << "\n " << path;
}
status.SetError(e.str());
cmSystemTools::SetFatalErrorOccured(); cmSystemTools::SetFatalErrorOccured();
return false; return false;
} }

View File

@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): ^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Could not resolve file libtest\.so$ file Could not resolve runtime dependencies:
libtest\.so$

View File

@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): ^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Could not resolve file libunresolved\.so$ file Could not resolve runtime dependencies:
libunresolved\.so$

View File

@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): ^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Could not resolve file @rpath/libunresolved\.dylib$ file Could not resolve runtime dependencies:
@rpath/libunresolved\.dylib$

View File

@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): ^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Could not resolve file (lib)?unresolved\.dll$ file Could not resolve runtime dependencies:
(lib)?unresolved\.dll$