From 4b55828a9f2afbc6c37e53f7cb0d4adec0fa73b5 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Mon, 15 Nov 2021 14:27:34 +0100 Subject: cmExpandListWithBacktrace: add handling of empty elements. --- Source/cmListFileCache.cxx | 6 +++--- Source/cmListFileCache.h | 5 +++-- Source/cmLocalGenerator.cxx | 4 ++-- 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 const& s) return os << s.Value; } -std::vector> ExpandListWithBacktrace( - std::string const& list, cmListFileBacktrace const& bt) +std::vector> cmExpandListWithBacktrace( + std::string const& list, cmListFileBacktrace const& bt, bool emptyArgs) { std::vector> result; - std::vector tmp = cmExpandedList(list); + std::vector 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 const& r) { return l == r.Value; } }; -std::vector> ExpandListWithBacktrace( +std::vector> 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& defines, std::string const& defines_list) const { std::set> tmp; - this->AppendDefines(tmp, ExpandListWithBacktrace(defines_list)); + this->AppendDefines(tmp, cmExpandListWithBacktrace(defines_list)); for (BT const& i : tmp) { defines.emplace(i.Value); } @@ -3214,7 +3214,7 @@ void cmLocalGenerator::AppendDefines(std::set>& defines, } // Expand the list of definitions. - this->AppendDefines(defines, ExpandListWithBacktrace(defines_list)); + this->AppendDefines(defines, cmExpandListWithBacktrace(defines_list)); } void cmLocalGenerator::AppendDefines( -- cgit v0.12