mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
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>
This commit is contained in:
@@ -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()) &&
|
||||
|
||||
Reference in New Issue
Block a user