summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-10 12:56:36 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-17 18:20:34 (GMT)
commite022e2d8734ffbc0378b75d85b32a2524302dd50 (patch)
treeef0d8193841b8c71a2f9631c7c9ace3b01c87456 /Source
parentf1dd0eeaaf264ebb35b048f423c66296e6967d16 (diff)
downloadCMake-e022e2d8734ffbc0378b75d85b32a2524302dd50.zip
CMake-e022e2d8734ffbc0378b75d85b32a2524302dd50.tar.gz
CMake-e022e2d8734ffbc0378b75d85b32a2524302dd50.tar.bz2
cmListFileCache: Add ExpandListWithBacktrace helper
Diffstat (limited to 'Source')
-rw-r--r--Source/cmListFileCache.cxx13
-rw-r--r--Source/cmListFileCache.h3
2 files changed, 16 insertions, 0 deletions
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<std::string> const& s)
{
return os << s.Value;
}
+
+std::vector<BT<std::string>> ExpandListWithBacktrace(
+ const char* list, cmListFileBacktrace const& bt)
+{
+ std::vector<BT<std::string>> result;
+ std::vector<std::string> 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<std::string> const& s);
+std::vector<BT<std::string>> ExpandListWithBacktrace(
+ const char* list, cmListFileBacktrace const& bt = cmListFileBacktrace());
+
struct cmListFile
{
bool ParseFile(const char* path, cmMessenger* messenger,