summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-11-15 13:27:34 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-02-06 13:32:24 (GMT)
commit4b55828a9f2afbc6c37e53f7cb0d4adec0fa73b5 (patch)
tree363750a44a9e759d40ec6fd04793fee33f20ec18 /Source
parent28d7432468932ea3a7425579e909d51fe36a70c7 (diff)
downloadCMake-4b55828a9f2afbc6c37e53f7cb0d4adec0fa73b5.zip
CMake-4b55828a9f2afbc6c37e53f7cb0d4adec0fa73b5.tar.gz
CMake-4b55828a9f2afbc6c37e53f7cb0d4adec0fa73b5.tar.bz2
cmExpandListWithBacktrace: add handling of empty elements.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmListFileCache.cxx6
-rw-r--r--Source/cmListFileCache.h5
-rw-r--r--Source/cmLocalGenerator.cxx4
3 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 3da266d..b28b282 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -539,11 +539,11 @@ std::ostream& operator<<(std::ostream& os, BT<std::string> const& s)
return os << s.Value;
}
-std::vector<BT<std::string>> ExpandListWithBacktrace(
- std::string const& list, cmListFileBacktrace const& bt)
+std::vector<BT<std::string>> cmExpandListWithBacktrace(
+ std::string const& list, cmListFileBacktrace const& bt, bool emptyArgs)
{
std::vector<BT<std::string>> result;
- std::vector<std::string> tmp = cmExpandedList(list);
+ std::vector<std::string> tmp = cmExpandedList(list, emptyArgs);
result.reserve(tmp.size());
for (std::string& i : tmp) {
result.emplace_back(std::move(i), bt);
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 5d45027..58bc57e 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -230,9 +230,10 @@ public:
friend bool operator==(T const& l, BTs<T> const& r) { return l == r.Value; }
};
-std::vector<BT<std::string>> ExpandListWithBacktrace(
+std::vector<BT<std::string>> cmExpandListWithBacktrace(
std::string const& list,
- cmListFileBacktrace const& bt = cmListFileBacktrace());
+ cmListFileBacktrace const& bt = cmListFileBacktrace(),
+ bool emptyArgs = false);
struct cmListFile
{
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2adb232..3976c42 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3199,7 +3199,7 @@ void cmLocalGenerator::AppendDefines(std::set<std::string>& defines,
std::string const& defines_list) const
{
std::set<BT<std::string>> tmp;
- this->AppendDefines(tmp, ExpandListWithBacktrace(defines_list));
+ this->AppendDefines(tmp, cmExpandListWithBacktrace(defines_list));
for (BT<std::string> const& i : tmp) {
defines.emplace(i.Value);
}
@@ -3214,7 +3214,7 @@ void cmLocalGenerator::AppendDefines(std::set<BT<std::string>>& defines,
}
// Expand the list of definitions.
- this->AppendDefines(defines, ExpandListWithBacktrace(defines_list));
+ this->AppendDefines(defines, cmExpandListWithBacktrace(defines_list));
}
void cmLocalGenerator::AppendDefines(