Features: Fix the COMPILE_FEATURES genex for unavailable features.

Previously, the genex tested only for CMake knowledge of the feature,
but not compiler knowledge of the feature.
This commit is contained in:
Stephen Kelly 2015-01-11 17:53:37 +01:00 committed by Brad King
parent 2bead0eb1b
commit 45ec182d27
1 changed files with 7 additions and 0 deletions

View File

@ -1373,9 +1373,16 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
for (LangMap::const_iterator lit = testedFeatures.begin(); for (LangMap::const_iterator lit = testedFeatures.begin();
lit != testedFeatures.end(); ++lit) lit != testedFeatures.end(); ++lit)
{ {
std::vector<std::string> const& langAvailable
= availableFeatures[lit->first];
for (std::vector<std::string>::const_iterator it = lit->second.begin(); for (std::vector<std::string>::const_iterator it = lit->second.begin();
it != lit->second.end(); ++it) it != lit->second.end(); ++it)
{ {
if (std::find(langAvailable.begin(), langAvailable.end(), *it)
== langAvailable.end())
{
return "0";
}
if (!context->Makefile->HaveStandardAvailable(target, if (!context->Makefile->HaveStandardAvailable(target,
lit->first, *it)) lit->first, *it))
{ {