summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx36
-rw-r--r--Source/cmGeneratorTarget.h3
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx31
-rw-r--r--Source/cmTarget.h3
7 files changed, 40 insertions, 39 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index a20579bb0e..49fc96ba72 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1625,7 +1625,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
std::string result = target->Target->GetPDBDirectory(context->Config);
result += "/";
- result += target->Target->GetPDBName(context->Config);
+ result += target->GetPDBName(context->Config);
return result;
}
};
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a125e474d6..a29f4c95a2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1525,7 +1525,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
}
// The program database file name.
- pdbName = this->Target->GetPDBName(config);
+ pdbName = this->GetPDBName(config);
}
//----------------------------------------------------------------------------
@@ -1587,7 +1587,39 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
impName = this->Target->GetFullNameInternal(config, true);
// The program database file name.
- pdbName = this->Target->GetPDBName(config);
+ pdbName = this->GetPDBName(config);
+}
+
+//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
+{
+ std::string prefix;
+ std::string base;
+ std::string suffix;
+ this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+
+ std::vector<std::string> props;
+ std::string configUpper =
+ cmSystemTools::UpperCase(config);
+ if(!configUpper.empty())
+ {
+ // PDB_NAME_<CONFIG>
+ props.push_back("PDB_NAME_" + configUpper);
+ }
+
+ // PDB_NAME
+ props.push_back("PDB_NAME");
+
+ for(std::vector<std::string>::const_iterator i = props.begin();
+ i != props.end(); ++i)
+ {
+ if(const char* outName = this->GetProperty(*i))
+ {
+ base = outName;
+ break;
+ }
+ }
+ return prefix+base+".pdb";
}
bool cmStrictTargetComparison::operator()(cmTarget const* t1,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 9cdfd0080c..441bbcf3b3 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -160,6 +160,9 @@ public:
std::vector<cmSourceFile*> const*
GetSourceDepends(cmSourceFile const* sf) const;
+ /** Get the name of the pdb file for the target. */
+ std::string GetPDBName(const std::string& config="") const;
+
/** Whether this library has soname enabled and platform supports it. */
bool HasSOName(const std::string& config) const;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f9125fc341..b94e151e7a 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -548,7 +548,7 @@ cmMakefileTargetGenerator
this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
- targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
+ targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
}
if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
{
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index e61ba6fe1a..16e1f48134 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -273,7 +273,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
{
pdbPath = this->Target->GetPDBDirectory(this->GetConfigName());
pdbPath += "/";
- pdbPath += this->Target->GetPDBName(this->GetConfigName());
+ pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
}
if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
{
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 188ad0f25c..1e7fb5a9e5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3461,37 +3461,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetPDBName(const std::string& config) const
-{
- std::string prefix;
- std::string base;
- std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
-
- std::vector<std::string> props;
- std::string configUpper = cmSystemTools::UpperCase(config);
- if(!configUpper.empty())
- {
- // PDB_NAME_<CONFIG>
- props.push_back("PDB_NAME_" + configUpper);
- }
-
- // PDB_NAME
- props.push_back("PDB_NAME");
-
- for(std::vector<std::string>::const_iterator i = props.begin();
- i != props.end(); ++i)
- {
- if(const char* outName = this->GetProperty(*i))
- {
- base = outName;
- break;
- }
- }
- return prefix+base+".pdb";
-}
-
-//----------------------------------------------------------------------------
bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
{
bool install_name_is_rpath = false;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 162033cb57..8c23372492 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -377,9 +377,6 @@ public:
const std::string& config="",
bool implib = false) const;
- /** Get the name of the pdb file for the target. */
- std::string GetPDBName(const std::string& config) const;
-
/** Whether this library has \@rpath and platform supports it. */
bool HasMacOSXRpathInstallNameDir(const std::string& config) const;