cmGeneratorTarget: Move GetPDBDirectory from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-05 18:39:17 +02:00
parent 8b0168863e
commit 50dc9b4440
11 changed files with 30 additions and 26 deletions

View File

@ -1631,7 +1631,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
return std::string();
}
std::string result = target->Target->GetPDBDirectory(context->Config);
std::string result = target->GetPDBDirectory(context->Config);
result += "/";
result += target->GetPDBName(context->Config);
return result;

View File

@ -1130,7 +1130,7 @@ cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const
std::string name = this->GetCompilePDBName(config);
if(dir.empty() && !name.empty())
{
dir = this->Target->GetPDBDirectory(config);
dir = this->GetPDBDirectory(config);
}
if(!dir.empty())
{
@ -4995,3 +4995,15 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
}
}
}
//----------------------------------------------------------------------------
std::string
cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
{
if(cmTarget::OutputInfo const* info = this->Target->GetOutputInfo(config))
{
// Return the directory in which the target will be built.
return info->PdbDir;
}
return "";
}

View File

@ -359,6 +359,12 @@ public:
/** Return true if builtin chrpath will work for this target */
bool IsChrpathUsed(const std::string& config) const;
/** Get the directory in which this targets .pdb files will be placed.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */
std::string GetPDBDirectory(const std::string& config) const;
///! Return the preferred linker language for this target
std::string GetLinkerLanguage(const std::string& config = "") const;

View File

@ -1220,7 +1220,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
this->OutputLibraryDirectories(fout, cli.GetDirectories());
fout << "\"\n";
temp = target.GetPDBDirectory(configName);
temp = gt->GetPDBDirectory(configName);
temp += "/";
temp += targetNamePDB;
fout << "\t\t\t\tProgramDatabaseFile=\"" <<
@ -1320,7 +1320,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
this->OutputLibraryDirectories(fout, cli.GetDirectories());
fout << "\"\n";
std::string path = this->ConvertToXMLOutputPathSingle(
target.GetPDBDirectory(configName).c_str());
gt->GetPDBDirectory(configName).c_str());
fout << "\t\t\t\tProgramDatabaseFile=\""
<< path << "/" << targetNamePDB
<< "\"\n";

View File

@ -133,7 +133,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
std::string pdbOutputPath =
this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
pdbOutputPath += "/";

View File

@ -314,7 +314,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str());
std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName);
std::string pdbOutputPath =
this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
pdbOutputPath += "/";

View File

@ -546,7 +546,8 @@ cmMakefileTargetGenerator
{
targetFullPathReal =
this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
targetFullPathPDB =
this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName);
}

View File

@ -289,7 +289,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
pdbPath = this->Target->GetPDBDirectory(this->GetConfigName());
pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName());
pdbPath += "/";
pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName());
}

View File

@ -1770,17 +1770,6 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
return &i->second;
}
//----------------------------------------------------------------------------
std::string cmTarget::GetPDBDirectory(const std::string& config) const
{
if(OutputInfo const* info = this->GetOutputInfo(config))
{
// Return the directory in which the target will be built.
return info->PdbDir;
}
return "";
}
//----------------------------------------------------------------------------
const char* cmTarget::ImportedGetLocation(const std::string& config) const
{

View File

@ -231,12 +231,6 @@ public:
the link dependencies of this target. */
std::string CheckCMP0004(std::string const& item) const;
/** Get the directory in which this targets .pdb files will be placed.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */
std::string GetPDBDirectory(const std::string& config) const;
const char* ImportedGetLocation(const std::string& config) const;
/** Get the target major and minor version numbers interpreted from

View File

@ -2581,7 +2581,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
{
linkOptions.AddFlag("GenerateDebugInformation", "false");
}
std::string pdb = this->Target->GetPDBDirectory(config.c_str());
std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
pdb += "/";
pdb += targetNamePDB;
std::string imLib =