summaryrefslogtreecommitdiff
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-17 11:34:32 -0500
committerBrad King <brad.king@kitware.com>2016-11-18 09:43:22 -0500
commitce1abfa4149ae0b3920626bef2dd15e8ee8b1940 (patch)
tree846f9be18d4c9918921221cdd9ca6304861af256 /Source/cmcmd.cxx
parent44de61578130cbd6e0f23057f9cf86f884078a4e (diff)
downloadcmake-ce1abfa4149ae0b3920626bef2dd15e8ee8b1940.tar.gz
cmake: If ldd for LINK_WHAT_YOU_USE fails to run then report why
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 945913ec50..dca5ffcf50 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -378,11 +378,15 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Run the ldd -u -r command line.
// 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;
- if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, CM_NULLPTR,
- &ret, CM_NULLPTR,
+ std::string stdErr;
+ if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, &stdErr, &ret,
+ CM_NULLPTR,
cmSystemTools::OUTPUT_NONE)) {
- std::cerr << "Error running '" << lwyu_cmd[0] << "'\n";
+ std::cerr << "Error running '" << lwyu_cmd[0] << "': " << stdErr
+ << "\n";
return 1;
}