MCPcopy Create free account
hub / github.com/Kitware/CMake / AddCacheEntry

Method AddCacheEntry

Source/cmGlobVerificationManager.cxx:162–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void cmGlobVerificationManager::AddCacheEntry(
163 cmGlobCacheEntry const& entry, std::string const& variable,
164 cmListFileBacktrace const& backtrace, cmMessenger* messenger)
165{
166 CacheEntryKey key =
167 CacheEntryKey(entry.Recurse, entry.ListDirectories, entry.FollowSymlinks,
168 entry.Relative, entry.Expression);
169 CacheEntryValue& value = this->Cache[key];
170 if (!value.Initialized) {
171 value.Files = entry.Files;
172 value.Initialized = true;
173 value.Backtraces.emplace_back(variable, backtrace);
174 } else if (value.Initialized && value.Files != entry.Files) {
175 std::ostringstream message;
176 message << std::boolalpha;
177 message << "The glob expression\n ";
178 key.PrintGlobCommand(message, variable);
179 message << "\nwas already present in the glob cache but the directory "
180 "contents have changed during the configuration run.\n";
181 message << "Matching glob expressions:";
182 for (auto const& bt : value.Backtraces) {
183 message << "\n " << std::get<0>(bt);
184 messenger->PrintBacktraceTitle(message, std::get<1>(bt));
185 }
186 messenger->IssueMessage(MessageType::FATAL_ERROR, message.str(),
187 backtrace);
188 } else {
189 value.Backtraces.emplace_back(variable, backtrace);
190 }
191}
192
193std::vector<cmGlobCacheEntry> cmGlobVerificationManager::GetCacheEntries()
194 const

Callers

nothing calls this directly

Calls 6

CacheEntryKeyClass · 0.85
emplace_backMethod · 0.80
PrintGlobCommandMethod · 0.80
PrintBacktraceTitleMethod · 0.80
strMethod · 0.80
IssueMessageMethod · 0.45

Tested by

no test coverage detected