summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-20 16:02:47 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-20 16:48:46 (GMT)
commit71e677392bb15b1ed87e98b75d19122cdc249c77 (patch)
treee35e36b40c91d4d81faedbe54ad4f2553c64ba40
parentebb9346490741ddc2ce6f552bc1be57dfc730cfa (diff)
downloadCMake-71e677392bb15b1ed87e98b75d19122cdc249c77.zip
CMake-71e677392bb15b1ed87e98b75d19122cdc249c77.tar.gz
CMake-71e677392bb15b1ed87e98b75d19122cdc249c77.tar.bz2
Do not collect objects from dependencies of object libraries
Object libraries do not link and therefore do not need to consider the object files from "linked" dependencies on other object libraries. This was an oversight in commit 57538224d0 (objlib: Link object-files from `OBJECT` libraries, 2017-12-14, v3.12.0-rc1~419^2~2). Fixes: #19744 Inspired-by: Julien Finet <julien.finet@kitware.com>
-rw-r--r--Source/cmGeneratorTarget.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 18ca478..8e3db2b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/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()) &&