浏览代码

cmGeneratorTarget: add the original target as a COMPILE_ONLY link

Fixes: #25909
Ben Boeckel 1 年之前
父节点
当前提交
2041f7c9bf
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Source/cmGeneratorTarget.cxx

+ 4 - 0
Source/cmGeneratorTarget.cxx

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