mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
export: Allow compatible build-tree exports
Modify how cmExportBuildFileGenerator::FindExportInfo collects target export information to properly record the export sets which export a target. (The old behavior treated every invocation as a separate set, which is reasonable for export(TARGETS) but does not allow referencing a target exported multiple times via export(EXPORT). This reflects recent changes to allow this for installed exports.)
This commit is contained in:
@@ -186,15 +186,20 @@ cmExportFileGenerator::ExportInfo cmExportBuildFileGenerator::FindExportInfo(
|
||||
target->GetLocalGenerator()->GetGlobalGenerator()->GetBuildExportSets();
|
||||
|
||||
for (auto const& exp : allExportSets) {
|
||||
auto const& exportSet = exp.second;
|
||||
cmExportBuildFileGenerator const* const bfg = exp.second;
|
||||
cmExportSet const* const exportSet = bfg->GetExportSet();
|
||||
std::vector<TargetExport> targets;
|
||||
exportSet->GetTargets(targets);
|
||||
bfg->GetTargets(targets);
|
||||
if (std::any_of(
|
||||
targets.begin(), targets.end(),
|
||||
[&name](TargetExport const& te) { return te.Name == name; })) {
|
||||
exportSets.insert(exp.first);
|
||||
if (exportSet) {
|
||||
exportSets.insert(exportSet->GetName());
|
||||
} else {
|
||||
exportSets.insert(exp.first);
|
||||
}
|
||||
exportFiles.push_back(exp.first);
|
||||
namespaces.insert(exportSet->GetNamespace());
|
||||
namespaces.insert(bfg->GetNamespace());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user