| 1289 | } |
| 1290 | |
| 1291 | std::string cmGeneratorTarget::GetCompilePDBName( |
| 1292 | std::string const& config) const |
| 1293 | { |
| 1294 | if (cmGeneratorTarget const* reuseTarget = this->GetPchReuseTarget()) { |
| 1295 | if (reuseTarget != this) { |
| 1296 | return reuseTarget->GetCompilePDBName(config); |
| 1297 | } |
| 1298 | } |
| 1299 | |
| 1300 | // Check for a per-configuration output directory target property. |
| 1301 | std::string configUpper = cmSystemTools::UpperCase(config); |
| 1302 | std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper); |
| 1303 | cmValue config_name = this->GetProperty(configProp); |
| 1304 | if (cmNonempty(config_name)) { |
| 1305 | std::string pdbName = cmGeneratorExpression::Evaluate( |
| 1306 | *config_name, this->LocalGenerator, config, this); |
| 1307 | NameComponents const& components = GetFullNameInternalComponents( |
| 1308 | config, cmStateEnums::RuntimeBinaryArtifact); |
| 1309 | return components.prefix + pdbName + ".pdb"; |
| 1310 | } |
| 1311 | |
| 1312 | cmValue name = this->GetProperty("COMPILE_PDB_NAME"); |
| 1313 | if (cmNonempty(name)) { |
| 1314 | std::string pdbName = cmGeneratorExpression::Evaluate( |
| 1315 | *name, this->LocalGenerator, config, this); |
| 1316 | NameComponents const& components = GetFullNameInternalComponents( |
| 1317 | config, cmStateEnums::RuntimeBinaryArtifact); |
| 1318 | return components.prefix + pdbName + ".pdb"; |
| 1319 | } |
| 1320 | |
| 1321 | // If the target is PCH-reused or PCH-reuses, we need a stable name for the |
| 1322 | // PDB file so that reusing targets can construct a stable name for it. |
| 1323 | cmGeneratorTarget const* reuseTarget = this->GetPchReuseTarget(); |
| 1324 | bool const hasReuse = reuseTarget && reuseTarget != this; |
| 1325 | if (this->PchReused || hasReuse) { |
| 1326 | NameComponents const& components = GetFullNameInternalComponents( |
| 1327 | config, cmStateEnums::RuntimeBinaryArtifact); |
| 1328 | return cmStrCat(components.prefix, this->GetName(), ".pdb"); |
| 1329 | } |
| 1330 | |
| 1331 | return std::string{}; |
| 1332 | } |
| 1333 | |
| 1334 | std::string cmGeneratorTarget::GetCompilePDBPath( |
| 1335 | std::string const& config) const |
no test coverage detected