Merge topic 'exported-modules-with-headers' into release-3.29

2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
051c2110c8 Tests/CXXModules: test exporting modules which include headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9469
This commit is contained in:
Brad King
2024-04-30 14:10:26 +00:00
committed by Kitware Robot
11 changed files with 188 additions and 0 deletions

View File

@@ -8483,6 +8483,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);