From ec348ee4b9f3dec09851f74226f2b0495bf17d8d Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Tue, 20 Feb 2024 08:00:41 -0500
Subject: cmGeneratorTarget: discover synthetic targets recursively

Fixes: #25288
---
 Source/cmGeneratorTarget.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3cfa5a9..40711a3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8380,6 +8380,7 @@ bool cmGeneratorTarget::DiscoverSyntheticTargets(cmSyntheticTargetCache& cache,
         auto gtp = cm::make_unique<cmGeneratorTarget>(tgt, lg);
         synthDep = gtp.get();
         cache.CxxModuleTargets[targetName] = synthDep;
+        gtp->DiscoverSyntheticTargets(cache, config);
         lg->AddGeneratorTarget(std::move(gtp));
       } else {
         synthDep = cached->second;
-- 
cgit v0.12