cmGeneratorTarget: add the original target as a COMPILE_ONLY link

Fixes: #25909
This commit is contained in:
Ben Boeckel
2024-04-26 20:14:10 -04:00
parent 051c2110c8
commit 2041f7c9bf

View File

@@ -8373,6 +8373,10 @@ bool cmGeneratorTarget::DiscoverSyntheticTargets(cmSyntheticTargetCache& cache,
// generation.
tgt->CopyImportedCxxModulesProperties(model);
tgt->AddLinkLibrary(*mf,
cmStrCat("$<COMPILE_ONLY:", model->GetName(), '>'),
GENERAL_LibraryType);
// Apply usage requirements to the target.
usage.ApplyToTarget(tgt);