summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-23 14:17:39 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-23 15:07:49 (GMT)
commitaaf59120bfd77a960317923da30e1a70ce0d8aae (patch)
tree9fba0f2e6c0157887ccf0848c3357dae58edee0a /Source/cmcmd.cxx
parent19612dffd27d90d73e3b7cff9cbba241294c17e9 (diff)
downloadCMake-aaf59120bfd77a960317923da30e1a70ce0d8aae.zip
CMake-aaf59120bfd77a960317923da30e1a70ce0d8aae.tar.gz
CMake-aaf59120bfd77a960317923da30e1a70ce0d8aae.tar.bz2
Source sweep: Replace cmExpandList with the shorter cmExpandedList
This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 0832e2f..2be8bae 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -172,8 +172,7 @@ static int HandleIWYU(const std::string& runCmd,
{
// Construct the iwyu command line by taking what was given
// and adding all the arguments we give to the compiler.
- std::vector<std::string> iwyu_cmd;
- cmExpandList(runCmd, iwyu_cmd, true);
+ std::vector<std::string> iwyu_cmd = cmExpandedList(runCmd, true);
cmAppend(iwyu_cmd, 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.
@@ -262,8 +261,7 @@ static int HandleCppLint(const std::string& runCmd,
const std::vector<std::string>&)
{
// Construct the cpplint command line.
- std::vector<std::string> cpplint_cmd;
- cmExpandList(runCmd, cpplint_cmd, true);
+ std::vector<std::string> cpplint_cmd = cmExpandedList(runCmd, true);
cpplint_cmd.push_back(sourceFile);
// Run the cpplint command line. Capture its output.
@@ -291,8 +289,7 @@ static int HandleCppCheck(const std::string& runCmd,
const std::vector<std::string>& orig_cmd)
{
// Construct the cpplint command line.
- std::vector<std::string> cppcheck_cmd;
- cmExpandList(runCmd, cppcheck_cmd, true);
+ std::vector<std::string> cppcheck_cmd = cmExpandedList(runCmd, true);
// extract all the -D, -U, and -I options from the compile line
for (auto const& opt : orig_cmd) {
if (opt.size() > 2) {