| 2563 | } |
| 2564 | |
| 2565 | void cmGeneratorTarget::AddCUDAArchitectureFlags(cmBuildStep compileOrLink, |
| 2566 | std::string const& config, |
| 2567 | std::string& flags) const |
| 2568 | { |
| 2569 | std::string arch = this->GetSafeProperty("CUDA_ARCHITECTURES"); |
| 2570 | |
| 2571 | if (arch.empty()) { |
| 2572 | switch (this->GetPolicyStatusCMP0104()) { |
| 2573 | case cmPolicies::WARN: |
| 2574 | if (!this->LocalGenerator->GetCMakeInstance()->GetIsInTryCompile()) { |
| 2575 | this->Makefile->IssueMessage( |
| 2576 | MessageType::AUTHOR_WARNING, |
| 2577 | cmPolicies::GetPolicyWarning(cmPolicies::CMP0104) + |
| 2578 | "\nCUDA_ARCHITECTURES is empty for target \"" + this->GetName() + |
| 2579 | "\"."); |
| 2580 | } |
| 2581 | CM_FALLTHROUGH; |
| 2582 | case cmPolicies::OLD: |
| 2583 | break; |
| 2584 | default: |
| 2585 | this->Makefile->IssueMessage( |
| 2586 | MessageType::FATAL_ERROR, |
| 2587 | "CUDA_ARCHITECTURES is empty for target \"" + this->GetName() + |
| 2588 | "\"."); |
| 2589 | } |
| 2590 | } |
| 2591 | |
| 2592 | // If CUDA_ARCHITECTURES is false we don't add any architectures. |
| 2593 | if (cmIsOff(arch)) { |
| 2594 | return; |
| 2595 | } |
| 2596 | |
| 2597 | this->AddCUDAArchitectureFlagsImpl(compileOrLink, config, "CUDA", |
| 2598 | std::move(arch), flags); |
| 2599 | } |
| 2600 | |
| 2601 | void cmGeneratorTarget::AddCUDAArchitectureFlagsImpl(cmBuildStep compileOrLink, |
| 2602 | std::string const& config, |
no test coverage detected