summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorTarget.cxx45
-rw-r--r--Source/cmGeneratorTarget.h6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmTarget.cxx43
-rw-r--r--Source/cmTarget.h6
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
8 files changed, 57 insertions, 53 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2b3ebee..a125e47 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -657,6 +657,51 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
}
//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::GetCompilePDBName(const std::string& config) const
+{
+ std::string prefix;
+ std::string base;
+ std::string suffix;
+ this->Target->GetFullNameInternal(config, false, prefix, base, suffix);
+
+ // Check for a per-configuration output directory target property.
+ std::string configUpper = cmSystemTools::UpperCase(config);
+ std::string configProp = "COMPILE_PDB_NAME_";
+ configProp += configUpper;
+ const char* config_name = this->Target->GetProperty(configProp);
+ if(config_name && *config_name)
+ {
+ return prefix + config_name + ".pdb";
+ }
+
+ const char* name = this->Target->GetProperty("COMPILE_PDB_NAME");
+ if(name && *name)
+ {
+ return prefix + name + ".pdb";
+ }
+
+ return "";
+}
+
+//----------------------------------------------------------------------------
+std::string
+cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const
+{
+ std::string dir = this->Target->GetCompilePDBDirectory(config);
+ std::string name = this->GetCompilePDBName(config);
+ if(dir.empty() && !name.empty())
+ {
+ dir = this->Target->GetPDBDirectory(config);
+ }
+ if(!dir.empty())
+ {
+ dir += "/";
+ }
+ return dir + name;
+}
+
+//----------------------------------------------------------------------------
bool cmGeneratorTarget::HasSOName(const std::string& config) const
{
// soname is supported only for shared libraries and modules,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 9254265..9cdfd00 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -163,6 +163,12 @@ public:
/** Whether this library has soname enabled and platform supports it. */
bool HasSOName(const std::string& config) const;
+ /** Get the name of the compiler pdb file for the target. */
+ std::string GetCompilePDBName(const std::string& config="") const;
+
+ /** Get the path for the MSVC /Fd option for this target. */
+ std::string GetCompilePDBPath(const std::string& config="") const;
+
/**
* Flags for a given source file as used in this target. Typically assigned
* via SET_TARGET_PROPERTIES when the property is a list of source files.
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index dd4cd33..799bac6 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -881,7 +881,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
if(target.GetType() <= cmTarget::OBJECT_LIBRARY)
{
// Specify the compiler program database file if configured.
- std::string pdb = target.GetCompilePDBPath(configName);
+ std::string pdb = gt->GetCompilePDBPath(configName);
if(!pdb.empty())
{
fout << "\t\t\t\tProgramDataBaseFileName=\""
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ac8cd29..f9125fc 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -553,7 +553,7 @@ cmMakefileTargetGenerator
if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
{
targetFullPathCompilePDB =
- this->Target->GetCompilePDBPath(this->ConfigName);
+ this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
if(targetFullPathCompilePDB.empty())
{
targetFullPathCompilePDB = this->Target->GetSupportDirectory() + "/";
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index cf80424..e61ba6f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -277,7 +277,8 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
}
if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY)
{
- compilePdbPath = this->Target->GetCompilePDBPath(this->GetConfigName());
+ compilePdbPath =
+ this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
if(compilePdbPath.empty())
{
compilePdbPath = this->Target->GetSupportDirectory() + "/";
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e1b3e94..188ad0f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3492,49 +3492,6 @@ std::string cmTarget::GetPDBName(const std::string& config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBName(const std::string& config) const
-{
- std::string prefix;
- std::string base;
- std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
-
- // Check for a per-configuration output directory target property.
- std::string configUpper = cmSystemTools::UpperCase(config);
- std::string configProp = "COMPILE_PDB_NAME_";
- configProp += configUpper;
- const char* config_name = this->GetProperty(configProp);
- if(config_name && *config_name)
- {
- return prefix + config_name + ".pdb";
- }
-
- const char* name = this->GetProperty("COMPILE_PDB_NAME");
- if(name && *name)
- {
- return prefix + name + ".pdb";
- }
-
- return "";
-}
-
-//----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBPath(const std::string& config) const
-{
- std::string dir = this->GetCompilePDBDirectory(config);
- std::string name = this->GetCompilePDBName(config);
- if(dir.empty() && !name.empty())
- {
- dir = this->GetPDBDirectory(config);
- }
- if(!dir.empty())
- {
- dir += "/";
- }
- return dir + name;
-}
-
-//----------------------------------------------------------------------------
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 e89a212..162033c 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -380,12 +380,6 @@ public:
/** Get the name of the pdb file for the target. */
std::string GetPDBName(const std::string& config) const;
- /** Get the name of the compiler pdb file for the target. */
- std::string GetCompilePDBName(const std::string& config="") const;
-
- /** Get the path for the MSVC /Fd option for this target. */
- std::string GetCompilePDBPath(const std::string& config="") const;
-
/** Whether this library has \@rpath and platform supports it. */
bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 83775a5..16edf3c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2026,7 +2026,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
// Specify the compiler program database file if configured.
- std::string pdb = this->Target->GetCompilePDBPath(configName.c_str());
+ std::string pdb =
+ this->GeneratorTarget->GetCompilePDBPath(configName.c_str());
if(!pdb.empty())
{
this->ConvertToWindowsSlash(pdb);