summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorjasjuang <jasjuang@gmail.com>2019-01-11 17:39:47 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-11 17:56:51 (GMT)
commitc834c47dfc8006fbdf95a22ea4241b53d7235915 (patch)
tree75c76549985c122d44ab4eba3b043e8d57e4b338 /Source/cmcmd.cxx
parent6092a770f66bff959749170141d44188f4b6f3f1 (diff)
downloadCMake-c834c47dfc8006fbdf95a22ea4241b53d7235915.zip
CMake-c834c47dfc8006fbdf95a22ea4241b53d7235915.tar.gz
CMake-c834c47dfc8006fbdf95a22ea4241b53d7235915.tar.bz2
cpplint: only print diagnostics to console if there are errors
Fixes: #18781
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 930ced9..7287594 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -270,9 +270,12 @@ static int HandleCppLint(const std::string& runCmd,
<< "\n";
return 1;
}
- std::cerr << "Warning: cpplint diagnostics:\n";
- // Output the output from cpplint to stderr
- std::cerr << stdOut;
+ if (!stdOut.empty()) {
+ std::cerr << "Warning: cpplint diagnostics:\n";
+ // Output the output from cpplint to stderr
+ std::cerr << stdOut;
+ }
+
// always return 0 so the build can continue as cpplint returns non-zero
// for any warning
return 0;