summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 4475d88..95e2187 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -416,7 +416,9 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
#endif
// Echo the custom command's comment text.
if (cm::optional<std::string> comment = ccg.GetComment()) {
- std::string echocmd = cmStrCat("echo ", *comment);
+ std::string escapedComment = this->LocalGenerator->EscapeForShell(
+ *comment, ccg.GetCC().GetEscapeAllowMakeVars());
+ std::string echocmd = cmStrCat("echo ", escapedComment);
cmdLines.push_back(std::move(echocmd));
}