| 3996 | } |
| 3997 | |
| 3998 | std::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 | |
| 4049 | std::string cmGeneratorTarget::GetPDBName(std::string const& config) const |
| 4050 | { |
no test coverage detected