Explorar o código

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.
Stephen Kelly %!s(int64=10) %!d(string=hai) anos
pai
achega
45ec182d27
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      Source/cmGeneratorExpressionEvaluator.cxx

+ 7 - 0
Source/cmGeneratorExpressionEvaluator.cxx

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