| 2169 | } |
| 2170 | |
| 2171 | void cmFastbuildNormalTargetGenerator::GenerateLink( |
| 2172 | FastbuildTarget& target, std::vector<std::string> const& objectDepends) |
| 2173 | { |
| 2174 | std::string const targetName = this->GetTargetName(); |
| 2175 | cmGeneratorTarget::Names const targetNames = DetectOutput(); |
| 2176 | LogMessage("targetNames.Real: " + targetNames.Real); |
| 2177 | LogMessage("targetNames.ImportOutput: " + targetNames.ImportOutput); |
| 2178 | LogMessage("targetNames.SharedObject: " + targetNames.SharedObject); |
| 2179 | LogMessage("targetNames.Base: " + targetNames.Base); |
| 2180 | |
| 2181 | std::vector<std::string> allNodes; |
| 2182 | auto const arches = this->GetArches(); |
| 2183 | for (std::size_t i = 0; i < arches.size(); ++i) { |
| 2184 | auto const& arch = arches[i]; |
| 2185 | FastbuildLinkerNode linkerNode; |
| 2186 | ProcessManifests(linkerNode); |
| 2187 | // Objects built by the current target. |
| 2188 | for (auto const& objectList : target.ObjectListNodes) { |
| 2189 | if (objectList.arch.empty() || objectList.arch == arch) { |
| 2190 | linkerNode.LibrarianAdditionalInputs.push_back(objectList.Name); |
| 2191 | } |
| 2192 | } |
| 2193 | |
| 2194 | // Detection of the link command as follows: |
| 2195 | auto const type = this->GeneratorTarget->GetType(); |
| 2196 | switch (type) { |
| 2197 | case cmStateEnums::EXECUTABLE: { |
| 2198 | LogMessage("Generating EXECUTABLE"); |
| 2199 | linkerNode.Type = FastbuildLinkerNode::EXECUTABLE; |
| 2200 | break; |
| 2201 | } |
| 2202 | case cmStateEnums::MODULE_LIBRARY: { |
| 2203 | LogMessage("Generating MODULE_LIBRARY"); |
| 2204 | linkerNode.Type = FastbuildLinkerNode::SHARED_LIBRARY; |
| 2205 | break; |
| 2206 | } |
| 2207 | case cmStateEnums::SHARED_LIBRARY: { |
| 2208 | LogMessage("Generating SHARED_LIBRARY"); |
| 2209 | linkerNode.Type = FastbuildLinkerNode::SHARED_LIBRARY; |
| 2210 | break; |
| 2211 | } |
| 2212 | case cmStateEnums::STATIC_LIBRARY: { |
| 2213 | LogMessage("Generating STATIC_LIBRARY"); |
| 2214 | linkerNode.Type = FastbuildLinkerNode::STATIC_LIBRARY; |
| 2215 | break; |
| 2216 | } |
| 2217 | case cmStateEnums::OBJECT_LIBRARY: { |
| 2218 | LogMessage("Generating OBJECT_LIBRARY"); |
| 2219 | return; |
| 2220 | } |
| 2221 | default: { |
| 2222 | LogMessage("Skipping GenerateLink"); |
| 2223 | return; |
| 2224 | } |
| 2225 | } |
| 2226 | |
| 2227 | std::string const targetOutput = |
| 2228 | ConvertToFastbuildPath(GeneratorTarget->GetFullPath(Config)); |
nothing calls this directly
no test coverage detected