|
|
@@ -2742,7 +2742,9 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
|
|
|
|
|
|
// Insert information about the current target's modules.
|
|
|
if (modmap_fmt) {
|
|
|
- auto cycle_modules = CxxModuleUsageSeed(locs, objects, usages);
|
|
|
+ bool private_usage_found = false;
|
|
|
+ auto cycle_modules =
|
|
|
+ CxxModuleUsageSeed(locs, objects, usages, private_usage_found);
|
|
|
if (!cycle_modules.empty()) {
|
|
|
cmSystemTools::Error(
|
|
|
cmStrCat("Circular dependency detected in the C++ module import "
|
|
|
@@ -2750,6 +2752,10 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
|
|
|
cmJoin(cycle_modules, R"(", ")"_s), '"'));
|
|
|
return false;
|
|
|
}
|
|
|
+ if (private_usage_found) {
|
|
|
+ // Already errored in the function.
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
cmNinjaBuild build("dyndep");
|