borland: support long comments for custom commands

Fixes: #28013
This commit is contained in:
Alex Overchenko
2026-08-06 07:24:16 +03:00
committed by AJIOB
parent 60c1f7fe45
commit ba93b9cf49
2 changed files with 12 additions and 6 deletions
+10
View File
@@ -1241,6 +1241,16 @@ std::string cmLocalUnixMakefileGenerator3::TrimLongCommand(
cm::static_string_view longCommandFinalizer = "..."_s;
size_t commandLineLimit = cmSystemTools::CalculateCommandLineLengthLimit();
if (this->GetState()->UseBorlandMake()) {
constexpr size_t BORLAND_MAKE_COMMAND_LINE_LIMIT = 4096;
commandLineLimit =
std::min(commandLineLimit, BORLAND_MAKE_COMMAND_LINE_LIMIT);
if (commandLineLimit == 0) {
commandLineLimit = BORLAND_MAKE_COMMAND_LINE_LIMIT;
}
}
if (commandLineLimit == 0) {
// No limit, just return the command as is.
return cmStrCat(std::move(cmd), this->EscapeForShell(line));
@@ -25,14 +25,10 @@ if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
run_configure_and_build(LotsOutputs)
endif()
# FIXME(#28019): LongCommentAutoGenerated test fails with Xcode generator on macOS 10.15 only.
# FIXME(#28013): LongCommentAutoGenerated test fails with Borland Makefiles generator.
if(NOT RunCMake_GENERATOR STREQUAL "Borland Makefiles" AND NOT RunCMake_GENERATOR STREQUAL "Xcode")
if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
run_configure_and_build(LongCommentAutoGenerated)
endif()
# FIXME(#28013): LongCommentUserProvided test fails with Borland Makefiles generator.
if(NOT RunCMake_GENERATOR STREQUAL "Borland Makefiles")
run_configure_and_build(LongCommentUserProvided)
endif()
run_configure_and_build(LongCommentUserProvided)
run_cmake(NoArguments)
run_cmake(NoOutputOrTarget)
run_cmake(OutputAndTarget)