|
|
@@ -71,6 +71,11 @@ struct cmTarget::ImportInfo
|
|
|
cmTarget::LinkInterface LinkInterface;
|
|
|
};
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+struct cmTarget::CompileInfo
|
|
|
+{
|
|
|
+};
|
|
|
+
|
|
|
struct TargetConfigPair : public std::pair<cmTarget const* , std::string> {
|
|
|
TargetConfigPair(cmTarget const* tgt, const std::string &config)
|
|
|
: std::pair<cmTarget const* , std::string>(tgt, config) {}
|
|
|
@@ -116,6 +121,9 @@ public:
|
|
|
ImportInfoMapType;
|
|
|
ImportInfoMapType ImportInfoMap;
|
|
|
|
|
|
+ typedef std::map<std::string, cmTarget::CompileInfo> CompileInfoMapType;
|
|
|
+ CompileInfoMapType CompileInfoMap;
|
|
|
+
|
|
|
// Cache link implementation computation from each configuration.
|
|
|
typedef std::map<TargetConfigPair,
|
|
|
cmTarget::LinkImplementation> LinkImplMapType;
|
|
|
@@ -2477,6 +2485,44 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
|
|
|
return &i->second;
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* 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->GetType());
|
|
|
+ this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg);
|
|
|
+ abort();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Lookup/compute/cache the compile information for this configuration.
|
|
|
+ std::string config_upper;
|
|
|
+ if(config && *config)
|
|
|
+ {
|
|
|
+ config_upper = cmSystemTools::UpperCase(config);
|
|
|
+ }
|
|
|
+ typedef cmTargetInternals::CompileInfoMapType CompileInfoMapType;
|
|
|
+ CompileInfoMapType::const_iterator i =
|
|
|
+ this->Internal->CompileInfoMap.find(config_upper);
|
|
|
+ if(i == this->Internal->CompileInfoMap.end())
|
|
|
+ {
|
|
|
+ CompileInfo info;
|
|
|
+ CompileInfoMapType::value_type entry(config_upper, info);
|
|
|
+ i = this->Internal->CompileInfoMap.insert(entry).first;
|
|
|
+ }
|
|
|
+ return &i->second;
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
std::string cmTarget::GetDirectory(const char* config, bool implib) const
|
|
|
{
|