| 1437 | } |
| 1438 | |
| 1439 | void 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 | |
| 1478 | void cmLocalGenerator::GetTargetFlags( |
| 1479 | cmLinkLineComputer* linkLineComputer, std::string const& config, |
no test coverage detected