From e022e2d8734ffbc0378b75d85b32a2524302dd50 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 10 Oct 2018 08:56:36 -0400 Subject: cmListFileCache: Add ExpandListWithBacktrace helper --- Source/cmListFileCache.cxx | 13 +++++++++++++ Source/cmListFileCache.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index d79afc6..d0495f7 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -479,3 +479,16 @@ std::ostream& operator<<(std::ostream& os, BT const& s) { return os << s.Value; } + +std::vector> ExpandListWithBacktrace( + const char* list, cmListFileBacktrace const& bt) +{ + std::vector> result; + std::vector tmp; + cmSystemTools::ExpandListArgument(list, tmp); + result.reserve(tmp.size()); + for (std::string& i : tmp) { + result.emplace_back(std::move(i), bt); + } + return result; +} diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 9f16b16..7c2802e 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -198,6 +198,9 @@ public: std::ostream& operator<<(std::ostream& os, BT const& s); +std::vector> ExpandListWithBacktrace( + const char* list, cmListFileBacktrace const& bt = cmListFileBacktrace()); + struct cmListFile { bool ParseFile(const char* path, cmMessenger* messenger, -- cgit v0.12