mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 23:28:32 -05:00
cmake: If ldd for LINK_WHAT_YOU_USE fails to run then report why
This commit is contained in:
+7
-3
@@ -378,11 +378,15 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
|||||||
|
|
||||||
// Run the ldd -u -r command line.
|
// Run the ldd -u -r command line.
|
||||||
// Capture its stdout and hide its stderr.
|
// Capture its stdout and hide its stderr.
|
||||||
|
// Ignore its return code because the tool always returns non-zero
|
||||||
|
// if there are any warnings, but we just want to warn.
|
||||||
std::string stdOut;
|
std::string stdOut;
|
||||||
if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, CM_NULLPTR,
|
std::string stdErr;
|
||||||
&ret, CM_NULLPTR,
|
if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, &stdErr, &ret,
|
||||||
|
CM_NULLPTR,
|
||||||
cmSystemTools::OUTPUT_NONE)) {
|
cmSystemTools::OUTPUT_NONE)) {
|
||||||
std::cerr << "Error running '" << lwyu_cmd[0] << "'\n";
|
std::cerr << "Error running '" << lwyu_cmd[0] << "': " << stdErr
|
||||||
|
<< "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user