| 85 | } |
| 86 | |
| 87 | void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( |
| 88 | bool relink) |
| 89 | { |
| 90 | #ifndef CMAKE_BOOTSTRAP |
| 91 | bool const requiresDeviceLinking = requireDeviceLinking( |
| 92 | *this->GeneratorTarget, *this->LocalGenerator, this->GetConfigName()); |
| 93 | if (!requiresDeviceLinking) { |
| 94 | return; |
| 95 | } |
| 96 | |
| 97 | std::vector<std::string> commands; |
| 98 | |
| 99 | // Get the name of the device object to generate. |
| 100 | std::string const& objExt = |
| 101 | this->Makefile->GetSafeDefinition("CMAKE_CUDA_OUTPUT_EXTENSION"); |
| 102 | std::string const targetOutput = |
| 103 | this->GeneratorTarget->ObjectDirectory + "cmake_device_link" + objExt; |
| 104 | this->DeviceLinkObject = targetOutput; |
| 105 | |
| 106 | this->NumberOfProgressActions++; |
| 107 | if (!this->NoRuleMessages) { |
| 108 | cmLocalUnixMakefileGenerator3::EchoProgress progress; |
| 109 | this->MakeEchoProgress(progress); |
| 110 | // Add the link message. |
| 111 | std::string buildEcho = cmStrCat( |
| 112 | "Linking CUDA device code ", |
| 113 | this->LocalGenerator->ConvertToOutputFormat( |
| 114 | this->LocalGenerator->MaybeRelativeToCurBinDir(this->DeviceLinkObject), |
| 115 | cmOutputConverter::SHELL)); |
| 116 | this->LocalGenerator->AppendEcho( |
| 117 | commands, buildEcho, cmLocalUnixMakefileGenerator3::EchoLink, &progress); |
| 118 | } |
| 119 | |
| 120 | if (this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID") == "Clang") { |
| 121 | this->WriteDeviceLinkRule(commands, targetOutput); |
| 122 | } else { |
| 123 | this->WriteNvidiaDeviceExecutableRule(relink, commands, targetOutput); |
| 124 | } |
| 125 | |
| 126 | // Write the main driver rule to build everything in this target. |
| 127 | this->WriteTargetDriverRule(targetOutput, relink); |
| 128 | #else |
| 129 | static_cast<void>(relink); |
| 130 | #endif |
| 131 | } |
| 132 | |
| 133 | void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule( |
| 134 | bool relink, std::vector<std::string>& commands, |
no test coverage detected