diff options
author | Brad King <brad.king@kitware.com> | 2016-04-29 17:28:28 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-04-29 17:28:28 (GMT) |
commit | 43e21ce9237c8e1a10e8252bc446497ce94b5797 (patch) | |
tree | 4d0d26f60e3d6c95687b287f1b34754bf14b000a | |
parent | aa304cbeb272d7c6802a991291531ab1ecc501af (diff) | |
parent | 304ab71db0fa68ff5cfe5e63adac6ade76ef6f31 (diff) | |
download | CMake-43e21ce9237c8e1a10e8252bc446497ce94b5797.zip CMake-43e21ce9237c8e1a10e8252bc446497ce94b5797.tar.gz CMake-43e21ce9237c8e1a10e8252bc446497ce94b5797.tar.bz2 |
Merge topic 'clang-tidy-argv0'
304ab71d Clang-Tidy: Give entire compiler command line to clant-tidy tool
-rw-r--r-- | Source/cmcmd.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 0b9518c..19f3886 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -382,12 +382,14 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if (!tidy.empty()) { // Construct the clang-tidy command line by taking what was given - // and adding all the arguments we give to the compiler. + // and adding our compiler command line. The clang-tidy tool will + // automatically skip over the compiler itself and extract the + // options. std::vector<std::string> tidy_cmd; cmSystemTools::ExpandListArgument(tidy, tidy_cmd, true); tidy_cmd.push_back(sourceFile); tidy_cmd.push_back("--"); - tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin()+1, orig_cmd.end()); + tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin(), orig_cmd.end()); // Run the tidy command line. Capture its stdout and hide its stderr. std::string stdOut; |