Browse Source

Merge topic 'INTERFACE-no-sources'

9db9c1fc cmTarget: Don't try to get sources of an INTERFACE_LIBRARY.
Brad King 11 years ago
parent
commit
10623032c7
3 changed files with 10 additions and 5 deletions
  1. 7 4
      Source/cmGeneratorTarget.cxx
  2. 2 1
      Source/cmGlobalGenerator.cxx
  3. 1 0
      Source/cmTarget.cxx

+ 7 - 4
Source/cmGeneratorTarget.cxx

@@ -498,11 +498,14 @@ cmTargetTraceDependencies
 
   // Queue all the source files already specified for the target.
   std::vector<cmSourceFile*> sources;
-  this->Target->GetSourceFiles(sources);
-  for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
-      si != sources.end(); ++si)
+  if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
     {
-    this->QueueSource(*si);
+    this->Target->GetSourceFiles(sources);
+    for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
+        si != sources.end(); ++si)
+      {
+      this->QueueSource(*si);
+      }
     }
 
   // Queue pre-build, pre-link, and post-build rule dependencies.

+ 2 - 1
Source/cmGlobalGenerator.cxx

@@ -1468,7 +1468,8 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
     for(cmGeneratorTargetsType::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
-      if (ti->second->Target->IsImported())
+      if (ti->second->Target->IsImported()
+          || ti->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
         {
         continue;
         }

+ 1 - 0
Source/cmTarget.cxx

@@ -551,6 +551,7 @@ bool cmTarget::FindSourceFiles()
 //----------------------------------------------------------------------------
 void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
 {
+  assert(this->GetType() != INTERFACE_LIBRARY);
   files = this->SourceFiles;
 }