summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 81752a6..39ac1b4 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -485,6 +485,38 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
}
}
+#ifdef _WIN32
+ {
+ const auto& value =
+ this->GenTarget->GetProperty("AUTOGEN_COMMAND_LINE_LENGTH_MAX");
+ if (value.IsSet()) {
+ using maxCommandLineLengthType =
+ decltype(this->AutogenTarget.MaxCommandLineLength);
+ unsigned long propInt = 0;
+ if (cmStrToULong(value, &propInt) && propInt > 0 &&
+ propInt <= std::numeric_limits<maxCommandLineLengthType>::max()) {
+ this->AutogenTarget.MaxCommandLineLength =
+ static_cast<maxCommandLineLengthType>(propInt);
+ } else {
+ // Warn the project author that AUTOGEN_PARALLEL is not valid.
+ this->Makefile->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat("AUTOGEN_COMMAND_LINE_LENGTH_MAX=\"", *value,
+ "\" for target \"", this->GenTarget->GetName(),
+ "\" is not valid. Using no limit for "
+ "AUTOGEN_COMMAND_LINE_LENGTH_MAX"));
+ this->AutogenTarget.MaxCommandLineLength =
+ std::numeric_limits<maxCommandLineLengthType>::max();
+ }
+ } else {
+ // Actually 32767 (see
+ // https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553) but
+ // we allow for a small margin
+ this->AutogenTarget.MaxCommandLineLength = 32000;
+ }
+ }
+#endif
+
// Autogen target info and settings files
{
// Info file
@@ -1692,6 +1724,10 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
// General
info.SetBool("MULTI_CONFIG", this->MultiConfig);
info.SetUInt("PARALLEL", this->AutogenTarget.Parallel);
+#ifdef _WIN32
+ info.SetUInt("AUTOGEN_COMMAND_LINE_LENGTH_MAX",
+ this->AutogenTarget.MaxCommandLineLength);
+#endif
info.SetUInt("VERBOSITY", this->Verbosity);
// Directories