diff options
author | Brad King <brad.king@kitware.com> | 2016-04-28 13:26:03 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-04-28 13:26:03 (GMT) |
commit | 3c189bbb3300bbb06523904880df79e6a20f66ec (patch) | |
tree | bfbbd705da3997e53129172ddd058db4b97cff69 | |
parent | a2de7f372c837b2744b8d722fc706a1e1bb6e015 (diff) | |
parent | 04d74a7f891dc01b2a9c6b1388f303af9404c49b (diff) | |
download | CMake-3c189bbb3300bbb06523904880df79e6a20f66ec.zip CMake-3c189bbb3300bbb06523904880df79e6a20f66ec.tar.gz CMake-3c189bbb3300bbb06523904880df79e6a20f66ec.tar.bz2 |
Merge topic 'clang-tidy-output-cleanup'
04d74a7f Clang-Tidy: copy stdout to sterr; ignore original stderr
-rw-r--r-- | Source/cmcmd.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 3c28c35..0b9518c 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -389,13 +389,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) tidy_cmd.push_back("--"); tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin()+1, orig_cmd.end()); - // Run the tidy command line. - if(!cmSystemTools::RunSingleCommand(tidy_cmd, 0, 0, &ret, 0, - cmSystemTools::OUTPUT_PASSTHROUGH)) + // Run the tidy command line. Capture its stdout and hide its stderr. + std::string stdOut; + if(!cmSystemTools::RunSingleCommand(tidy_cmd, &stdOut, 0, &ret, 0, + cmSystemTools::OUTPUT_NONE)) { std::cerr << "Error running '" << tidy_cmd[0] << "'\n"; return 1; } + + // Output the stdout from clang-tidy to stderr + std::cerr << stdOut; } // Now run the real compiler command and return its result value. |