浏览代码

cmExpandListWithBacktrace: add handling of empty elements.

Marc Chevrier 3 年之前
父节点
当前提交
4b55828a9f
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 3 3
      Source/cmListFileCache.cxx
  2. 3 2
      Source/cmListFileCache.h
  3. 2 2
      Source/cmLocalGenerator.cxx

+ 3 - 3
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);

+ 3 - 2
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
 {

+ 2 - 2
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(