summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-04 17:19:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-05 16:20:50 (GMT)
commitf83e84028ac28ce098ea76bd857ae1663c295494 (patch)
tree0a56259fdc251b1c79a1f74611586c0657fd7f95 /Source/cmGeneratorTarget.cxx
parentb3f0e35308993de825f00ec18fc6559e6609c9b0 (diff)
downloadCMake-f83e84028ac28ce098ea76bd857ae1663c295494.zip
CMake-f83e84028ac28ce098ea76bd857ae1663c295494.tar.gz
CMake-f83e84028ac28ce098ea76bd857ae1663c295494.tar.bz2
cmGeneratorTarget: Move CompileInfoMap from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx42
1 files changed, 41 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c6f248c..c831704 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1356,6 +1356,46 @@ cmGeneratorTarget::GetMacContentDirectory(const std::string& config,
return fpath;
}
+
+//----------------------------------------------------------------------------
+cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
+ const std::string& config) const
+{
+ // There is no compile information for imported targets.
+ if(this->IsImported())
+ {
+ return 0;
+ }
+
+ if(this->GetType() > cmTarget::OBJECT_LIBRARY)
+ {
+ std::string msg = "cmTarget::GetCompileInfo called for ";
+ msg += this->GetName();
+ msg += " which has type ";
+ msg += cmTarget::GetTargetTypeName(this->Target->GetType());
+ this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ return 0;
+ }
+
+ // Lookup/compute/cache the compile information for this configuration.
+ std::string config_upper;
+ if(!config.empty())
+ {
+ config_upper = cmSystemTools::UpperCase(config);
+ }
+ CompileInfoMapType::const_iterator i =
+ this->CompileInfoMap.find(config_upper);
+ if(i == this->CompileInfoMap.end())
+ {
+ CompileInfo info;
+ this->Target
+ ->ComputePDBOutputDir("COMPILE_PDB", config, info.CompilePdbDir);
+ CompileInfoMapType::value_type entry(config_upper, info);
+ i = this->CompileInfoMap.insert(entry).first;
+ }
+ return &i->second;
+}
+
//----------------------------------------------------------------------------
std::string
cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
@@ -1827,7 +1867,7 @@ void cmGeneratorTarget::TraceDependencies()
std::string
cmGeneratorTarget::GetCompilePDBDirectory(const std::string& config) const
{
- if(cmTarget::CompileInfo const* info = this->Target->GetCompileInfo(config))
+ if(CompileInfo const* info = this->GetCompileInfo(config))
{
return info->CompilePdbDir;
}