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

Method DumpLinkCommandFragments

Source/cmFileAPICodemodel.cxx:2220–2274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2218}
2219
2220Json::Value Target::DumpLinkCommandFragments()
2221{
2222 Json::Value linkFragments = Json::arrayValue;
2223
2224 std::string linkLanguageFlags;
2225 std::vector<BT<std::string>> linkFlags;
2226 std::string frameworkPath;
2227 std::vector<BT<std::string>> linkPath;
2228 std::vector<BT<std::string>> linkLibs;
2229 cmLocalGenerator* lg = this->GT->GetLocalGenerator();
2230 cmGlobalGenerator* gg = this->GT->GetGlobalGenerator();
2231 std::unique_ptr<cmLinkLineComputer> linkLineComputer =
2232 gg->CreateLinkLineComputer(lg, lg->GetStateSnapshot().GetDirectory());
2233 lg->GetTargetFlags(linkLineComputer.get(), this->Config, linkLibs,
2234 linkLanguageFlags, linkFlags, frameworkPath, linkPath,
2235 this->GT);
2236 linkLanguageFlags = cmTrimWhitespace(linkLanguageFlags);
2237 frameworkPath = cmTrimWhitespace(frameworkPath);
2238
2239 if (!linkLanguageFlags.empty()) {
2240 linkFragments.append(
2241 this->DumpCommandFragment(std::move(linkLanguageFlags), "flags"));
2242 }
2243
2244 if (!linkFlags.empty()) {
2245 for (BT<std::string> frag : linkFlags) {
2246 frag.Value = cmTrimWhitespace(frag.Value);
2247 linkFragments.append(
2248 this->DumpCommandFragment(this->ToJBT(frag), "flags"));
2249 }
2250 }
2251
2252 if (!frameworkPath.empty()) {
2253 linkFragments.append(
2254 this->DumpCommandFragment(std::move(frameworkPath), "frameworkPath"));
2255 }
2256
2257 if (!linkPath.empty()) {
2258 for (BT<std::string> frag : linkPath) {
2259 frag.Value = cmTrimWhitespace(frag.Value);
2260 linkFragments.append(
2261 this->DumpCommandFragment(this->ToJBT(frag), "libraryPath"));
2262 }
2263 }
2264
2265 if (!linkLibs.empty()) {
2266 for (BT<std::string> frag : linkLibs) {
2267 frag.Value = cmTrimWhitespace(frag.Value);
2268 linkFragments.append(
2269 this->DumpCommandFragment(this->ToJBT(frag), "libraries"));
2270 }
2271 }
2272
2273 return linkFragments;
2274}
2275
2276Json::Value Target::DumpCommandFragments(
2277 std::vector<JBT<std::string>> const& frags)

Callers 2

DumpLinkMethod · 0.95
DumpArchiveMethod · 0.95

Calls 13

DumpCommandFragmentMethod · 0.95
ToJBTMethod · 0.95
cmTrimWhitespaceFunction · 0.85
moveFunction · 0.85
GetTargetFlagsMethod · 0.80
appendMethod · 0.80
GetLocalGeneratorMethod · 0.45
GetGlobalGeneratorMethod · 0.45
GetDirectoryMethod · 0.45
GetStateSnapshotMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected