diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2024-02-15 01:25:53 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2024-02-15 01:26:59 (GMT) |
commit | 3f8a59a05c7d2c65020bd2a756d2c6d5a196bec2 (patch) | |
tree | 3413c107267f4dd4c9e60aac32507da2a4d23a17 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 5e984bb35232116a54de7db39788cb162ca7c263 (diff) | |
download | CMake-3f8a59a05c7d2c65020bd2a756d2c6d5a196bec2.zip CMake-3f8a59a05c7d2c65020bd2a756d2c6d5a196bec2.tar.gz CMake-3f8a59a05c7d2c65020bd2a756d2c6d5a196bec2.tar.bz2 |
cxxmodules: return failure from the collator when private usage is found
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 22fd90d..b74ba37 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2719,7 +2719,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 " @@ -2727,6 +2729,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"); |