diff options
author | Brad King <brad.king@kitware.com> | 2019-09-20 16:02:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-20 16:48:46 (GMT) |
commit | 71e677392bb15b1ed87e98b75d19122cdc249c77 (patch) | |
tree | e35e36b40c91d4d81faedbe54ad4f2553c64ba40 /Source/cmGeneratorTarget.cxx | |
parent | ebb9346490741ddc2ce6f552bc1be57dfc730cfa (diff) | |
download | CMake-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>
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 11 |
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()) && |