1
0
Эх сурвалжийг харах

cmGeneratorTarget: add the original target as a COMPILE_ONLY link

Fixes: #25909
Ben Boeckel 1 жил өмнө
parent
commit
2041f7c9bf

+ 4 - 0
Source/cmGeneratorTarget.cxx

@@ -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);