Jelajahi Sumber

Avoid certain actions on IMPORTED targets.

As we're iterating over IMPORTED targets now, handle them in
the loop body. The existing behavior is harmless because generally
nothing is done anyway for IMPORTED targets in these code paths,
because they do not have sources for example.
Stephen Kelly 12 tahun lalu
induk
melakukan
41e48c45e8
2 mengubah file dengan 12 tambahan dan 0 penghapusan
  1. 4 0
      Source/cmGlobalGenerator.cxx
  2. 8 0
      Source/cmLocalGenerator.cxx

+ 4 - 0
Source/cmGlobalGenerator.cxx

@@ -1379,6 +1379,10 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
     for(cmGeneratorTargetsType::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
+      if (ti->second->Target->IsImported())
+        {
+        continue;
+        }
       cmGeneratorTarget* gt = ti->second;
       gt->ClassifySources();
       gt->LookupObjectLibraries();

+ 8 - 0
Source/cmLocalGenerator.cxx

@@ -261,6 +261,10 @@ void cmLocalGenerator::TraceDependencies()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
+    if (t->second->Target->IsImported())
+      {
+      continue;
+      }
     t->second->TraceDependencies();
     }
 }
@@ -545,6 +549,10 @@ void cmLocalGenerator::GenerateTargetManifest()
       {
       continue;
       }
+    if (target.Target->IsImported())
+      {
+      continue;
+      }
     if(configNames.empty())
       {
       target.GenerateTargetManifest(0);