Browse Source

Merge topic 'object-library-sources'

71e677392b Do not collect objects from dependencies of object libraries

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3843
Brad King 6 years ago
parent
commit
15163c9234
1 changed files with 7 additions and 4 deletions
  1. 7 4
      Source/cmGeneratorTarget.cxx

+ 7 - 4
Source/cmGeneratorTarget.cxx

@@ -1454,11 +1454,14 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
     this, linkInterfaceSourcesEntries, files, uniqueSrcs, debugSources);
 
   // Collect TARGET_OBJECTS of direct object link-dependencies.
-  std::vector<EvaluatedTargetPropertyEntry> linkObjectsEntries;
-  AddObjectEntries(this, config, &dagChecker, linkObjectsEntries);
+  bool contextDependentObjects = false;
   std::vector<std::string>::size_type numFilesBefore2 = files.size();
-  bool contextDependentObjects =
-    processSources(this, linkObjectsEntries, files, uniqueSrcs, debugSources);
+  if (this->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+    std::vector<EvaluatedTargetPropertyEntry> linkObjectsEntries;
+    AddObjectEntries(this, config, &dagChecker, linkObjectsEntries);
+    contextDependentObjects = processSources(this, linkObjectsEntries, files,
+                                             uniqueSrcs, debugSources);
+  }
 
   if (!contextDependentDirectSources &&
       !(contextDependentInterfaceSources && numFilesBefore < files.size()) &&