cmGeneratorTarget: Move GetCompilePDBDirectory from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-04 19:19:51 +02:00
parent 34c437411d
commit b3f0e35308
6 changed files with 24 additions and 26 deletions

View File

@ -743,7 +743,7 @@ cmGeneratorTarget::GetCompilePDBName(const std::string& config) const
std::string
cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const
{
std::string dir = this->Target->GetCompilePDBDirectory(config);
std::string dir = this->GetCompilePDBDirectory(config);
std::string name = this->GetCompilePDBName(config);
if(dir.empty() && !name.empty())
{
@ -1824,6 +1824,16 @@ void cmGeneratorTarget::TraceDependencies()
tracer.Trace();
}
std::string
cmGeneratorTarget::GetCompilePDBDirectory(const std::string& config) const
{
if(cmTarget::CompileInfo const* info = this->Target->GetCompileInfo(config))
{
return info->CompilePdbDir;
}
return "";
}
//----------------------------------------------------------------------------
void cmGeneratorTarget::GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const

View File

@ -214,6 +214,12 @@ public:
*/
void TraceDependencies();
/** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
compiler pdb output directory is given. */
std::string GetCompilePDBDirectory(const std::string& config = "") const;
/** Get sources that must be built before the given source. */
std::vector<cmSourceFile*> const*
GetSourceDepends(cmSourceFile const* sf) const;

View File

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

View File

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

View File

@ -68,12 +68,6 @@ struct cmTarget::OutputInfo
std::string PdbDir;
};
//----------------------------------------------------------------------------
struct cmTarget::CompileInfo
{
std::string CompilePdbDir;
};
//----------------------------------------------------------------------------
class cmTargetInternals
{
@ -2672,16 +2666,6 @@ std::string cmTarget::GetPDBDirectory(const std::string& config) const
return "";
}
//----------------------------------------------------------------------------
std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
{
if(CompileInfo const* info = this->GetCompileInfo(config))
{
return info->CompilePdbDir;
}
return "";
}
//----------------------------------------------------------------------------
const char* cmTarget::ImportedGetLocation(const std::string& config) const
{

View File

@ -334,12 +334,6 @@ public:
pdb output directory is given. */
std::string GetPDBDirectory(const std::string& config) const;
/** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
compiler pdb output directory is given. */
std::string GetCompilePDBDirectory(const std::string& config = "") const;
const char* ImportedGetLocation(const std::string& config) const;
/** Get the target major and minor version numbers interpreted from
@ -633,7 +627,11 @@ private:
ImportInfo& info) const;
// Cache target compile paths for each configuration.
struct CompileInfo;
struct CompileInfo
{
std::string CompilePdbDir;
};
CompileInfo const* GetCompileInfo(const std::string& config) const;
LinkInterface const*