summaryrefslogtreecommitdiffstats
path: root/Source/cmParseArgumentsCommand.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-06-20 14:32:27 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-06-22 13:44:17 (GMT)
commit45f17e5a8566fcdec0071a5ed1bc2656968bf258 (patch)
treed7391fbaa4ab69666ced6dd940892c5c401bcfca /Source/cmParseArgumentsCommand.cxx
parent88e7ad0084bd6a2fa6f032d7be1ee5d993440dcf (diff)
downloadCMake-45f17e5a8566fcdec0071a5ed1bc2656968bf258.zip
CMake-45f17e5a8566fcdec0071a5ed1bc2656968bf258.tar.gz
CMake-45f17e5a8566fcdec0071a5ed1bc2656968bf258.tar.bz2
cmList: Add container conversion to string
Diffstat (limited to 'Source/cmParseArgumentsCommand.cxx')
-rw-r--r--Source/cmParseArgumentsCommand.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx
index b0462f0..f193ed9 100644
--- a/Source/cmParseArgumentsCommand.cxx
+++ b/Source/cmParseArgumentsCommand.cxx
@@ -20,7 +20,9 @@
#include "cmSystemTools.h"
#include "cmValue.h"
-static std::string EscapeArg(const std::string& arg)
+namespace {
+
+std::string EscapeArg(const std::string& arg)
{
// replace ";" with "\;" so output argument lists will split correctly
std::string escapedArg;
@@ -33,14 +35,12 @@ static std::string EscapeArg(const std::string& arg)
return escapedArg;
}
-static std::string JoinList(std::vector<std::string> const& arg, bool escape)
+std::string JoinList(std::vector<std::string> const& arg, bool escape)
{
- return escape ? cmJoin(cmMakeRange(arg).transform(EscapeArg), ";")
- : cmJoin(cmMakeRange(arg), ";");
+ return escape ? cmList::to_string(cmMakeRange(arg).transform(EscapeArg))
+ : cmList::to_string(cmMakeRange(arg));
}
-namespace {
-
using options_map = std::map<std::string, bool>;
using single_map = std::map<std::string, std::string>;
using multi_map =
@@ -108,8 +108,9 @@ static void PassParsedArguments(
}
if (!keywordsMissingValues.empty()) {
- makefile.AddDefinition(prefix + "KEYWORDS_MISSING_VALUES",
- cmJoin(cmMakeRange(keywordsMissingValues), ";"));
+ makefile.AddDefinition(
+ prefix + "KEYWORDS_MISSING_VALUES",
+ cmList::to_string(cmMakeRange(keywordsMissingValues)));
} else {
makefile.RemoveDefinition(prefix + "KEYWORDS_MISSING_VALUES");
}