cmake: Comment why we ignore the include-what-you-use return code

The include-what-you-use tool always returns non-zero to indicate that
it did not actually produce an object file as Clang would from the same
command line.  Add a comment explaining that this is why we ignore its
return code.  Also update our `pseudo_iwyu` test suite tool to always
exit with an error too.
This commit is contained in:
Brad King 2016-11-17 11:33:24 -05:00
parent 0e9634d2c9
commit 44de615781
2 changed files with 3 additions and 1 deletions

View File

@ -327,6 +327,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
iwyu_cmd.insert(iwyu_cmd.end(), orig_cmd.begin() + 1, orig_cmd.end());
// Run the iwyu command line. Capture its stderr and hide its stdout.
// Ignore its return code because the tool always returns non-zero.
std::string stdErr;
if (!cmSystemTools::RunSingleCommand(iwyu_cmd, CM_NULLPTR, &stdErr,
&ret, CM_NULLPTR,

View File

@ -3,5 +3,6 @@
int main(void)
{
fprintf(stderr, "should add these lines:\n#include <...>\n");
return 0;
/* include-what-you-use always returns failure */
return 1;
}