MCPcopy Create free account
hub / github.com/Kitware/CMake / GetCompilePDBName

Method GetCompilePDBName

Source/cmGeneratorTarget.cxx:1291–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289}
1290
1291std::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
1334std::string cmGeneratorTarget::GetCompilePDBPath(
1335 std::string const& config) const

Callers 2

GetCompilePDBPathMethod · 0.95
CopyPchCompilePdbMethod · 0.80

Calls 5

GetPchReuseTargetMethod · 0.95
GetPropertyMethod · 0.95
cmNonemptyFunction · 0.85
cmStrCatFunction · 0.70
GetNameMethod · 0.45

Tested by

no test coverage detected