| 245 | } |
| 246 | |
| 247 | char const* cmGeneratorTarget::GetOutputTargetType( |
| 248 | cmStateEnums::ArtifactType artifact) const |
| 249 | { |
| 250 | if (this->IsFrameworkOnApple() || this->GetGlobalGenerator()->IsXcode()) { |
| 251 | // import file (i.e. .tbd file) is always in same location as library |
| 252 | artifact = cmStateEnums::RuntimeBinaryArtifact; |
| 253 | } |
| 254 | |
| 255 | switch (this->GetType()) { |
| 256 | case cmStateEnums::SHARED_LIBRARY: |
| 257 | if (this->IsDLLPlatform()) { |
| 258 | switch (artifact) { |
| 259 | case cmStateEnums::RuntimeBinaryArtifact: |
| 260 | // A DLL shared library is treated as a runtime target. |
| 261 | return "RUNTIME"; |
| 262 | case cmStateEnums::ImportLibraryArtifact: |
| 263 | // A DLL import library is treated as an archive target. |
| 264 | return "ARCHIVE"; |
| 265 | } |
| 266 | } else { |
| 267 | switch (artifact) { |
| 268 | case cmStateEnums::RuntimeBinaryArtifact: |
| 269 | // For non-DLL platforms shared libraries are treated as |
| 270 | // library targets. |
| 271 | return "LIBRARY"; |
| 272 | case cmStateEnums::ImportLibraryArtifact: |
| 273 | // Library import libraries are treated as archive targets. |
| 274 | return "ARCHIVE"; |
| 275 | } |
| 276 | } |
| 277 | break; |
| 278 | case cmStateEnums::STATIC_LIBRARY: |
| 279 | // Static libraries are always treated as archive targets. |
| 280 | return "ARCHIVE"; |
| 281 | case cmStateEnums::MODULE_LIBRARY: |
| 282 | switch (artifact) { |
| 283 | case cmStateEnums::RuntimeBinaryArtifact: |
| 284 | // Module libraries are always treated as library targets. |
| 285 | return "LIBRARY"; |
| 286 | case cmStateEnums::ImportLibraryArtifact: |
| 287 | // Module import libraries are treated as archive targets. |
| 288 | return "ARCHIVE"; |
| 289 | } |
| 290 | break; |
| 291 | case cmStateEnums::OBJECT_LIBRARY: |
| 292 | // Object libraries are always treated as object targets. |
| 293 | return "OBJECT"; |
| 294 | case cmStateEnums::EXECUTABLE: |
| 295 | switch (artifact) { |
| 296 | case cmStateEnums::RuntimeBinaryArtifact: |
| 297 | // Executables are always treated as runtime targets. |
| 298 | return "RUNTIME"; |
| 299 | case cmStateEnums::ImportLibraryArtifact: |
| 300 | // Executable import libraries are treated as archive targets. |
| 301 | return "ARCHIVE"; |
| 302 | } |
| 303 | break; |
| 304 | default: |
no test coverage detected