浏览代码

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 年之前
父节点
当前提交
15163c9234
共有 1 个文件被更改,包括 7 次插入4 次删除
  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()) &&