Browse Source

Autogen: Use new API for limiting autogen command line lengths

tophoo 2 years ago
parent
commit
232610e60e
3 changed files with 2 additions and 12 deletions
  1. 0 7
      Source/cmQtAutoGen.cxx
  2. 0 5
      Source/cmQtAutoGen.h
  3. 2 0
      Source/cmQtAutoMocUic.cxx

+ 0 - 7
Source/cmQtAutoGen.cxx

@@ -76,13 +76,6 @@ static void MergeOptions(std::vector<std::string>& baseOpts,
 
 unsigned int const cmQtAutoGen::ParallelMax = 64;
 
-#ifdef _WIN32
-// Actually 32767 (see
-// https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553) but we
-// allow for a small margin
-size_t const cmQtAutoGen::CommandLineLengthMax = 32000;
-#endif
-
 cm::string_view cmQtAutoGen::GeneratorName(GenT genType)
 {
   switch (genType) {

+ 0 - 5
Source/cmQtAutoGen.h

@@ -64,11 +64,6 @@ public:
   /// @brief Maximum number of parallel threads/processes in a generator
   static unsigned int const ParallelMax;
 
-#ifdef _WIN32
-  /// @brief Maximum number of characters on command line
-  static size_t const CommandLineLengthMax;
-#endif
-
   /// @brief Returns the generator name
   static cm::string_view GeneratorName(GenT genType);
   /// @brief Returns the generator name in upper case

+ 2 - 0
Source/cmQtAutoMocUic.cxx

@@ -887,6 +887,8 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
       cm::append(cmd, this->MocConst().OptionsDefinitions);
       // Add includes
       cm::append(cmd, this->MocConst().OptionsIncludes);
+      // Check if response file is necessary
+      MaybeWriteResponseFile(this->MocConst().PredefsFileAbs, cmd);
       // Execute command
       if (!this->RunProcess(GenT::MOC, result, cmd, reason.get())) {
         this->LogCommandError(GenT::MOC,