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

Method AddSystemIncludeCacheKey

Source/cmGeneratorTarget.cxx:1219–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1217}
1218
1219void cmGeneratorTarget::AddSystemIncludeCacheKey(
1220 std::string const& key, std::string const& config,
1221 std::string const& language) const
1222{
1223 cm::GenEx::Context context(this->LocalGenerator, config, language);
1224 cmGeneratorExpressionDAGChecker dagChecker{
1225 this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr, context,
1226 };
1227
1228 bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
1229
1230 cmList result;
1231 for (std::string const& it : this->Target->GetSystemIncludeDirectories()) {
1232 result.append(
1233 cmGeneratorExpression::Evaluate(it, context.LG, context.Config, this,
1234 &dagChecker, nullptr, context.Language));
1235 }
1236
1237 std::vector<cmGeneratorTarget const*> const& deps =
1238 this->GetLinkImplementationClosure(config, UseTo::Compile);
1239 for (cmGeneratorTarget const* dep : deps) {
1240 handleSystemIncludesDep(context.LG, dep, context.Config, this, &dagChecker,
1241 result, excludeImported, context.Language);
1242 }
1243
1244 cmLinkImplementation const* impl =
1245 this->GetLinkImplementation(config, UseTo::Compile);
1246 if (impl) {
1247 auto runtimeEntries = impl->LanguageRuntimeLibraries.find(language);
1248 if (runtimeEntries != impl->LanguageRuntimeLibraries.end()) {
1249 for (auto const& lib : runtimeEntries->second) {
1250 if (lib.Target) {
1251 handleSystemIncludesDep(context.LG, lib.Target, context.Config, this,
1252 &dagChecker, result, excludeImported,
1253 context.Language);
1254 }
1255 }
1256 }
1257 }
1258
1259 std::for_each(result.begin(), result.end(),
1260 cmSystemTools::ConvertToUnixSlashes);
1261 std::sort(result.begin(), result.end());
1262 result.erase(std::unique(result.begin(), result.end()), result.end());
1263 SystemIncludesCache.emplace(key, result);
1264}
1265
1266bool cmGeneratorTarget::IsSystemIncludeDirectory(
1267 std::string const& dir, std::string const& config,

Callers 2

Calls 9

GetPropertyAsBoolMethod · 0.95
GetLinkImplementationMethod · 0.95
handleSystemIncludesDepFunction · 0.85
appendMethod · 0.80
eraseMethod · 0.80
emplaceMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected