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

Method AppendToLibraries2IfApplicable

Source/cmFastbuildNormalTargetGenerator.cxx:1971–1996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1969}
1970
1971void cmFastbuildNormalTargetGenerator::AppendToLibraries2IfApplicable(
1972 FastbuildLinkerNode& linkerNode, std::string dep) const
1973{
1974 // Strings like "-framework Cocoa" in .Libraries2 node will always make the
1975 // target out-of-date (since it never exists).
1976 if (this->GeneratorTarget->IsApple() &&
1977 cmSystemTools::StringStartsWith(dep, "-framework")) {
1978 LogMessage(cmStrCat("Not adding framework: ", dep, " to .Libraries2"));
1979 return;
1980 }
1981
1982 auto const target = this->GetGlobalGenerator()->GetTargetByOutputName(dep);
1983 // Fastbuild doesn't support executables in .Libraries2, though we can use
1984 // Executables via "-bundle_loader" on Apple.
1985 if (this->GeneratorTarget->IsApple() && target &&
1986 !target->LinkerNode.empty() &&
1987 target->LinkerNode[0].Type == FastbuildLinkerNode::EXECUTABLE) {
1988 LogMessage(cmStrCat("Not adding DLL/Executable(", linkerNode.Name,
1989 " to .Libraries2"));
1990 return;
1991 }
1992
1993 // Adding to .Libraries2 for tracking.
1994 LogMessage(cmStrCat("Adding ", dep, " .Libraries2"));
1995 linkerNode.Libraries2.emplace_back(std::move(dep));
1996}
1997
1998void cmFastbuildNormalTargetGenerator::AppendLINK_DEPENDS(
1999 FastbuildLinkerNode& linkerNode) const

Callers

nothing calls this directly

Calls 7

moveFunction · 0.85
GetTargetByOutputNameMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
IsAppleMethod · 0.45
GetGlobalGeneratorMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected