cmExpandListWithBacktrace: add handling of empty elements.
This commit is contained in:
parent
28d7432468
commit
4b55828a9f
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user