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

Method GetDeviceLinkFlags

Source/cmLocalGenerator.cxx:1439–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1437}
1438
1439void cmLocalGenerator::GetDeviceLinkFlags(
1440 cmLinkLineDeviceComputer& linkLineComputer, std::string const& config,
1441 std::string& linkLibs, std::string& linkFlags, std::string& frameworkPath,
1442 std::string& linkPath, cmGeneratorTarget* target)
1443{
1444 cmGeneratorTarget::DeviceLinkSetter setter(*target);
1445
1446 cmComputeLinkInformation* pcli = target->GetLinkInformation(config);
1447
1448 auto linklang = linkLineComputer.GetLinkerLanguage(target, config);
1449 auto ipoEnabled = target->IsIPOEnabled(linklang, config);
1450 if (!ipoEnabled && pcli) {
1451 ipoEnabled = linkLineComputer.ComputeRequiresDeviceLinkingIPOFlag(*pcli);
1452 }
1453 if (ipoEnabled) {
1454 if (cmValue cudaIPOFlags = this->Makefile->GetDefinition(
1455 "CMAKE_CUDA_DEVICE_LINK_OPTIONS_IPO")) {
1456 linkFlags += *cudaIPOFlags;
1457 }
1458 }
1459
1460 if (pcli) {
1461 // Compute the required device link libraries when
1462 // resolving gpu lang device symbols
1463 this->OutputLinkLibraries(pcli, &linkLineComputer, linkLibs, frameworkPath,
1464 linkPath);
1465 }
1466
1467 this->AddVisibilityPresetFlags(linkFlags, target, "CUDA");
1468 this->GetGlobalGenerator()->EncodeLiteral(linkFlags);
1469
1470 std::vector<std::string> linkOpts;
1471 target->GetLinkOptions(linkOpts, config, "CUDA");
1472 this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript());
1473 // LINK_OPTIONS are escaped.
1474 this->AppendCompileOptions(linkFlags, linkOpts);
1475 this->SetLinkScriptShell(false);
1476}
1477
1478void cmLocalGenerator::GetTargetFlags(
1479 cmLinkLineComputer* linkLineComputer, std::string const& config,

Calls 12

OutputLinkLibrariesMethod · 0.95
GetGlobalGeneratorMethod · 0.95
AppendCompileOptionsMethod · 0.95
GetLinkInformationMethod · 0.80
IsIPOEnabledMethod · 0.80
GetLinkOptionsMethod · 0.80
SetLinkScriptShellMethod · 0.80
GetUseLinkScriptMethod · 0.80
GetLinkerLanguageMethod · 0.45
GetDefinitionMethod · 0.45

Tested by

no test coverage detected