| 79 | } |
| 80 | |
| 81 | std::vector<std::string> cmDefinitions::ClosureKeys(StackIter begin, |
| 82 | StackIter end) |
| 83 | { |
| 84 | std::vector<std::string> defined; |
| 85 | std::unordered_set<cm::string_view> bound; |
| 86 | |
| 87 | for (StackIter it = begin; it != end; ++it) { |
| 88 | defined.reserve(defined.size() + it->Map.size()); |
| 89 | for (auto const& mi : it->Map) { |
| 90 | // Use this key if it is not already set or unset. |
| 91 | if (bound.emplace(mi.first.view()).second && mi.second.Value) { |
| 92 | defined.push_back(*mi.first.str_if_stable()); |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | return defined; |
| 98 | } |
| 99 | |
| 100 | void cmDefinitions::Set(std::string const& key, cm::string_view value) |
| 101 | { |