cmGeneratorTarget: Port internal API to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2015-08-04 19:19:43 +02:00
parent 90bad039c4
commit 38d4ba3564
1 changed files with 15 additions and 13 deletions

View File

@ -1525,23 +1525,23 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty(
} }
template<typename PropertyType> template<typename PropertyType>
PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt, PropertyType getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
const std::string& prop, const std::string& prop,
const std::string& config, const std::string& config,
cmTarget::CompatibleType, cmTarget::CompatibleType,
PropertyType *); PropertyType *);
template<> template<>
bool getLinkInterfaceDependentProperty(cmTarget const* tgt, bool getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
const std::string& prop, const std::string& prop,
const std::string& config, const std::string& config,
cmTarget::CompatibleType, bool *) cmTarget::CompatibleType, bool *)
{ {
return tgt->GetLinkInterfaceDependentBoolProperty(prop, config); return tgt->Target->GetLinkInterfaceDependentBoolProperty(prop, config);
} }
template<> template<>
const char * getLinkInterfaceDependentProperty(cmTarget const* tgt, const char * getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
const std::string& prop, const std::string& prop,
const std::string& config, const std::string& config,
cmTarget::CompatibleType t, cmTarget::CompatibleType t,
@ -1553,11 +1553,13 @@ const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
assert(0 && "String compatibility check function called for boolean"); assert(0 && "String compatibility check function called for boolean");
return 0; return 0;
case cmTarget::StringType: case cmTarget::StringType:
return tgt->GetLinkInterfaceDependentStringProperty(prop, config); return tgt->Target->GetLinkInterfaceDependentStringProperty(prop, config);
case cmTarget::NumberMinType: case cmTarget::NumberMinType:
return tgt->GetLinkInterfaceDependentNumberMinProperty(prop, config); return tgt->Target
->GetLinkInterfaceDependentNumberMinProperty(prop, config);
case cmTarget::NumberMaxType: case cmTarget::NumberMaxType:
return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config); return tgt->Target
->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
} }
assert(0 && "Unreachable!"); assert(0 && "Unreachable!");
return 0; return 0;
@ -1565,7 +1567,7 @@ const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
template<typename PropertyType> template<typename PropertyType>
void checkPropertyConsistency(cmTarget const* depender, void checkPropertyConsistency(cmGeneratorTarget const* depender,
cmTarget const* dependee, cmTarget const* dependee,
const std::string& propName, const std::string& propName,
std::set<std::string> &emitted, std::set<std::string> &emitted,
@ -1597,7 +1599,7 @@ void checkPropertyConsistency(cmTarget const* depender,
<< *pi << "\" listed in its " << propName << " property. " << *pi << "\" listed in its " << propName << " property. "
"This is not allowed. Only user-defined properties may appear " "This is not allowed. Only user-defined properties may appear "
"listed in the " << propName << " property."; "listed in the " << propName << " property.";
depender->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str()); depender->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, e.str());
return; return;
} }
if(emitted.insert(*pi).second) if(emitted.insert(*pi).second)
@ -1681,14 +1683,14 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
continue; continue;
} }
checkPropertyConsistency<bool>(this->Target, li->Target, checkPropertyConsistency<bool>(this, li->Target,
strBool, strBool,
emittedBools, config, cmTarget::BoolType, 0); emittedBools, config, cmTarget::BoolType, 0);
if (cmSystemTools::GetErrorOccuredFlag()) if (cmSystemTools::GetErrorOccuredFlag())
{ {
return; return;
} }
checkPropertyConsistency<const char *>(this->Target, li->Target, checkPropertyConsistency<const char *>(this, li->Target,
strString, strString,
emittedStrings, config, emittedStrings, config,
cmTarget::StringType, 0); cmTarget::StringType, 0);
@ -1696,7 +1698,7 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
{ {
return; return;
} }
checkPropertyConsistency<const char *>(this->Target, li->Target, checkPropertyConsistency<const char *>(this, li->Target,
strNumMin, strNumMin,
emittedMinNumbers, config, emittedMinNumbers, config,
cmTarget::NumberMinType, 0); cmTarget::NumberMinType, 0);
@ -1704,7 +1706,7 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
{ {
return; return;
} }
checkPropertyConsistency<const char *>(this->Target, li->Target, checkPropertyConsistency<const char *>(this, li->Target,
strNumMax, strNumMax,
emittedMaxNumbers, config, emittedMaxNumbers, config,
cmTarget::NumberMaxType, 0); cmTarget::NumberMaxType, 0);