summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-04-14 14:48:16 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-04-24 08:41:10 (GMT)
commite08ba229ee3107bcb814ca45bc9c72a48abf1ba2 (patch)
treec34d2ca05820acbb31202c5bdbc102059441076b /Source/cmcmd.cxx
parent51b0d45d9120d4bca5c7285d5e6b2f80db5a8310 (diff)
downloadCMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.zip
CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.gz
CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.bz2
CMake code rely on cmList class for CMake lists management (part. 1)
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index a2a9e09..036ddc6 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -14,6 +14,7 @@
#include "cmConsoleBuf.h"
#include "cmDuration.h"
#include "cmGlobalGenerator.h"
+#include "cmList.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmQtAutoMocUic.h"
@@ -342,7 +343,7 @@ int HandleIWYU(const std::string& runCmd, const std::string& /* sourceFile */,
{
// 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 = cmExpandedList(runCmd, true);
+ cmList iwyu_cmd{ runCmd, cmList::EmptyElements::Yes };
cm::append(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.
@@ -366,7 +367,7 @@ int HandleIWYU(const std::string& runCmd, const std::string& /* sourceFile */,
int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
const std::vector<std::string>& orig_cmd)
{
- std::vector<std::string> tidy_cmd = cmExpandedList(runCmd, true);
+ cmList tidy_cmd{ runCmd, cmList::EmptyElements::Yes };
tidy_cmd.push_back(sourceFile);
for (auto const& arg : tidy_cmd) {
@@ -416,7 +417,7 @@ int HandleLWYU(const std::string& runCmd, const std::string& sourceFile,
{
// Construct the ldd -r -u (link what you use lwyu) command line
// ldd -u -r lwuy target
- std::vector<std::string> lwyu_cmd = cmExpandedList(runCmd, true);
+ cmList lwyu_cmd{ runCmd, cmList::EmptyElements::Yes };
lwyu_cmd.push_back(sourceFile);
// Run the lwyu check command line, currently ldd is expected.
@@ -444,7 +445,7 @@ int HandleCppLint(const std::string& runCmd, const std::string& sourceFile,
const std::vector<std::string>&)
{
// Construct the cpplint command line.
- std::vector<std::string> cpplint_cmd = cmExpandedList(runCmd, true);
+ cmList cpplint_cmd{ runCmd, cmList::EmptyElements::Yes };
cpplint_cmd.push_back(sourceFile);
// Run the cpplint command line. Capture its output.
@@ -471,7 +472,7 @@ int HandleCppCheck(const std::string& runCmd, const std::string& sourceFile,
const std::vector<std::string>& orig_cmd)
{
// Construct the cpplint command line.
- std::vector<std::string> cppcheck_cmd = cmExpandedList(runCmd, true);
+ cmList cppcheck_cmd{ runCmd, cmList::EmptyElements::Yes };
// extract all the -D, -U, and -I options from the compile line
for (auto const& opt : orig_cmd) {
if (opt.size() > 2) {