Jelajahi Sumber

cmTarget: Simplify INTERFACE_COMPILE_FEATURES usage requirement lookup

Use the AddInterfaceEntries helper to avoid duplication.
Brad King 11 tahun lalu
induk
melakukan
f77b384cf6
1 mengubah file dengan 3 tambahan dan 39 penghapusan
  1. 3 39
      Source/cmTarget.cxx

+ 3 - 39
Source/cmTarget.cxx

@@ -2615,45 +2615,9 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
 
   if (!this->Internal->CacheLinkInterfaceCompileFeaturesDone[config])
     {
-    for (std::vector<cmValueWithOrigin>::const_iterator
-        it = this->Internal->LinkImplementationPropertyEntries.begin(),
-        end = this->Internal->LinkImplementationPropertyEntries.end();
-        it != end; ++it)
-      {
-      if (!cmGeneratorExpression::IsValidTargetName(it->Value)
-          && cmGeneratorExpression::Find(it->Value) == std::string::npos)
-        {
-        continue;
-        }
-      {
-      cmGeneratorExpression ge;
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-                                                        ge.Parse(it->Value);
-      std::string targetResult = cge->Evaluate(this->Makefile, config,
-                                        false, this, 0, 0);
-      if (!this->Makefile->FindTargetToUse(targetResult))
-        {
-        continue;
-        }
-      }
-      std::string featureGenex = "$<TARGET_PROPERTY:" +
-                              it->Value + ",INTERFACE_COMPILE_FEATURES>";
-      if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
-        {
-        // Because it->Value is a generator expression, ensure that it
-        // evaluates to the non-empty string before being used in the
-        // TARGET_PROPERTY expression.
-        featureGenex = "$<$<BOOL:" + it->Value + ">:" + featureGenex + ">";
-        }
-      cmGeneratorExpression ge(&it->Backtrace);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
-                                                                featureGenex);
-
-      this->Internal
-        ->CachedLinkInterfaceCompileFeaturesEntries[config].push_back(
-                        new cmTargetInternals::TargetPropertyEntry(cge,
-                                                              it->Value));
-      }
+    this->Internal->AddInterfaceEntries(
+      this, config, "INTERFACE_COMPILE_FEATURES",
+      this->Internal->CachedLinkInterfaceCompileFeaturesEntries[config]);
     }
 
   processCompileFeatures(this,