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

Method GetPDBOutputName

Source/cmGeneratorTarget.cxx:3998–4047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3996}
3997
3998std::string cmGeneratorTarget::GetPDBOutputName(
3999 std::string const& config) const
4000{
4001 // Lookup/compute/cache the pdb output name for this configuration.
4002 auto i = this->PdbOutputNameMap.find(config);
4003 if (i == this->PdbOutputNameMap.end()) {
4004 // Add empty name in map to detect potential recursion.
4005 PdbOutputNameMapType::value_type entry(config, "");
4006 i = this->PdbOutputNameMap.insert(entry).first;
4007
4008 // Compute output name.
4009 std::vector<std::string> props;
4010 std::string configUpper = cmSystemTools::UpperCase(config);
4011 if (!configUpper.empty()) {
4012 // PDB_NAME_<CONFIG>
4013 props.push_back("PDB_NAME_" + configUpper);
4014 }
4015
4016 // PDB_NAME
4017 props.emplace_back("PDB_NAME");
4018
4019 std::string outName;
4020 for (std::string const& p : props) {
4021 if (cmValue outNameProp = this->GetProperty(p)) {
4022 outName = *outNameProp;
4023 break;
4024 }
4025 }
4026
4027 // Now evaluate genex and update the previously-prepared map entry.
4028 if (outName.empty()) {
4029 i->second = cmStrCat(
4030 this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact),
4031 this->GetPolicyStatusCMP0202() != cmPolicies::NEW
4032 ? this->GetFilePostfix(config)
4033 : "");
4034 } else {
4035 i->second =
4036 cmGeneratorExpression::Evaluate(outName, this->LocalGenerator, config);
4037 }
4038 } else if (i->second.empty()) {
4039 // An empty map entry indicates we have been called recursively
4040 // from the above block.
4041 this->LocalGenerator->GetCMakeInstance()->IssueMessage(
4042 MessageType::FATAL_ERROR,
4043 cmStrCat("Target '", this->GetName(), "' PDB_NAME depends on itself."),
4044 this->GetBacktrace());
4045 }
4046 return i->second;
4047}
4048
4049std::string cmGeneratorTarget::GetPDBName(std::string const& config) const
4050{

Callers 2

GetPDBNameMethod · 0.95
GetMethod · 0.80

Calls 14

GetPropertyMethod · 0.95
GetOutputNameMethod · 0.95
GetFilePostfixMethod · 0.95
GetBacktraceMethod · 0.95
push_backMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
IssueMessageMethod · 0.45

Tested by

no test coverage detected