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

Method AddIncludeFlags

Source/cmMakefileTargetGenerator.cxx:2304–2339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2302}
2303
2304void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
2305 std::string const& lang,
2306 std::string const& /*config*/)
2307{
2308 std::string const responseVar =
2309 cmStrCat("CMAKE_", lang, "_USE_RESPONSE_FILE_FOR_INCLUDES");
2310 bool const useResponseFile = this->Makefile->IsOn(responseVar);
2311
2312 std::vector<std::string> includes;
2313 this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget,
2314 lang, this->GetConfigName());
2315
2316 std::string const includeFlags = this->LocalGenerator->GetIncludeFlags(
2317 includes, this->GeneratorTarget, lang, this->GetConfigName(),
2318 useResponseFile);
2319 if (includeFlags.empty()) {
2320 return;
2321 }
2322
2323 if (useResponseFile) {
2324 std::string const responseFlagVar =
2325 "CMAKE_" + lang + "_RESPONSE_FILE_FLAG";
2326 std::string responseFlag =
2327 this->Makefile->GetSafeDefinition(responseFlagVar);
2328 if (responseFlag.empty()) {
2329 responseFlag = "@";
2330 }
2331 std::string const name = cmStrCat("includes_", lang, ".rsp");
2332 std::string const arg = std::move(responseFlag) +
2333 this->CreateResponseFile(name, includeFlags, this->FlagFileDepends[lang],
2334 lang);
2335 this->LocalGenerator->AppendFlags(flags, arg);
2336 } else {
2337 this->LocalGenerator->AppendFlags(flags, includeFlags);
2338 }
2339}
2340
2341void cmMakefileTargetGenerator::GenDefFile(
2342 std::vector<std::string>& real_link_commands)

Callers

nothing calls this directly

Calls 8

CreateResponseFileMethod · 0.95
moveFunction · 0.85
GetIncludeFlagsMethod · 0.80
cmStrCatFunction · 0.70
IsOnMethod · 0.45
GetIncludeDirectoriesMethod · 0.45
emptyMethod · 0.45
AppendFlagsMethod · 0.45

Tested by

no test coverage detected