Procházet zdrojové kódy

Ninja: Fix regression with `.bat` wrapper around `ninja`

Revise the change from commit 5a36d0c9e7 (Ninja: Fix regression with a
large number of subdirectories, 2025-03-04, v4.0.0-rc3~2^2) to use a
command-line length limit small enough for `.bat` files.

Fixes: #27153
Brad King před 5 měsíci
rodič
revize
6de40e7a4d
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      Source/cmGlobalNinjaGenerator.cxx

+ 3 - 2
Source/cmGlobalNinjaGenerator.cxx

@@ -705,8 +705,9 @@ void cmGlobalNinjaGenerator::CleanMetaData()
     auto output_it = outputs.begin();
     size_t static_arg_size = ninja_tool_arg_size + this->NinjaCommand.size() +
       this->GetCMakeInstance()->GetHomeOutputDirectory().size();
-    // The Windows command-line length limit is 32768.  Leave plenty.
-    constexpr size_t maximum_arg_size = 30000;
+    // The Windows command-line length limit is 32768, but if `ninja` is
+    // wrapped by a `.bat` file, the limit is 8192.  Leave plenty.
+    constexpr size_t maximum_arg_size = 8000;
     while (output_it != outputs.end()) {
       size_t total_arg_size = static_arg_size;
       std::vector<char const*> args;