ENH: Added cmTarget::GetPDBName method to simplify computation of .pdb file name for a target.
This commit is contained in:
parent
ed7de15676
commit
4bc0fd0941
|
@ -638,29 +638,17 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
|||
{
|
||||
if(target.GetType() == cmTarget::EXECUTABLE)
|
||||
{
|
||||
std::string targetName;
|
||||
std::string targetNameFull;
|
||||
std::string targetNamePDB;
|
||||
target.GetExecutableNames(targetName, targetNameFull,
|
||||
targetNamePDB, configName);
|
||||
fout << "\t\t\t\tProgramDataBaseFileName=\""
|
||||
<< this->ExecutableOutputPath
|
||||
<< "$(OutDir)/" << targetNamePDB << "\"\n";
|
||||
<< "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
|
||||
}
|
||||
else if(target.GetType() == cmTarget::STATIC_LIBRARY ||
|
||||
target.GetType() == cmTarget::SHARED_LIBRARY ||
|
||||
target.GetType() == cmTarget::MODULE_LIBRARY)
|
||||
{
|
||||
std::string targetName;
|
||||
std::string targetNameSO;
|
||||
std::string targetNameFull;
|
||||
std::string targetNameImport;
|
||||
std::string targetNamePDB;
|
||||
target.GetLibraryNames(targetName, targetNameSO, targetNameFull,
|
||||
targetNameImport, targetNamePDB, configName);
|
||||
fout << "\t\t\t\tProgramDataBaseFileName=\""
|
||||
<< this->LibraryOutputPath
|
||||
<< "$(OutDir)/" << targetNamePDB << "\"\n";
|
||||
<< "$(OutDir)/" << target.GetPDBName(configName) << "\"\n";
|
||||
}
|
||||
}
|
||||
fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
|
||||
|
|
|
@ -1375,6 +1375,17 @@ const char* cmTarget::GetPrefixVariableInternal(TargetType type,
|
|||
return "";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmTarget::GetPDBName(const char* config)
|
||||
{
|
||||
std::string prefix;
|
||||
std::string base;
|
||||
std::string suffix;
|
||||
this->GetFullNameInternal(this->GetType(), config, false,
|
||||
prefix, base, suffix);
|
||||
return prefix+base+".pdb";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmTarget::GetFullName(const char* config, bool implib)
|
||||
{
|
||||
|
|
|
@ -205,6 +205,9 @@ public:
|
|||
void GetFullName(std::string& prefix,
|
||||
std::string& base, std::string& suffix,
|
||||
const char* config=0, bool implib = false);
|
||||
|
||||
/** Get the name of the pdb file for the target. */
|
||||
std::string GetPDBName(const char* config=0);
|
||||
|
||||
/** Get the full path to the target according to the settings in its
|
||||
makefile and the configuration type. */
|
||||
|
|
Loading…
Reference in New Issue