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

Method CollectDlls

Source/cmGeneratorExpressionNode.cxx:4348–4388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4346struct TargetRuntimeDllsBaseNode : public cmGeneratorExpressionNode
4347{
4348 std::vector<std::string> CollectDlls(
4349 std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
4350 GeneratorExpressionContent const* content) const
4351 {
4352 std::string const& tgtName = parameters.front();
4353 cmGeneratorTarget* gt =
4354 eval->Context.LG->FindGeneratorTargetToUse(tgtName);
4355 if (!gt) {
4356 std::ostringstream e;
4357 e << "Objects of target \"" << tgtName
4358 << "\" referenced but no such target exists.";
4359 reportError(eval, content->GetOriginalExpression(), e.str());
4360 return std::vector<std::string>();
4361 }
4362 cmStateEnums::TargetType type = gt->GetType();
4363 if (type != cmStateEnums::EXECUTABLE &&
4364 type != cmStateEnums::SHARED_LIBRARY &&
4365 type != cmStateEnums::MODULE_LIBRARY) {
4366 std::ostringstream e;
4367 e << "Objects of target \"" << tgtName
4368 << "\" referenced but is not one of the allowed target types "
4369 << "(EXECUTABLE, SHARED, MODULE).";
4370 reportError(eval, content->GetOriginalExpression(), e.str());
4371 return std::vector<std::string>();
4372 }
4373
4374 if (auto* cli = gt->GetLinkInformation(eval->Context.Config)) {
4375 std::vector<std::string> dllPaths;
4376 auto const& dlls = cli->GetRuntimeDLLs();
4377
4378 for (auto const& dll : dlls) {
4379 if (auto loc = dll->MaybeGetLocation(eval->Context.Config)) {
4380 dllPaths.emplace_back(*loc);
4381 }
4382 }
4383
4384 return dllPaths;
4385 }
4386
4387 return std::vector<std::string>();
4388 }
4389};
4390
4391static const struct TargetRuntimeDllsNode : public TargetRuntimeDllsBaseNode

Callers

nothing calls this directly

Calls 9

reportErrorFunction · 0.85
GetOriginalExpressionMethod · 0.80
strMethod · 0.80
GetLinkInformationMethod · 0.80
MaybeGetLocationMethod · 0.80
emplace_backMethod · 0.80
frontMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected