summaryrefslogtreecommitdiffstats
path: root/Source/cmGhsMultiTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGhsMultiTargetGenerator.cxx')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 138d3f1..8471dfe 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -9,6 +9,8 @@
#include <utility>
#include <vector>
+#include <cm/optional>
+
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
@@ -411,9 +413,8 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
cmdLines.push_back("@echo off");
#endif
// Echo the custom command's comment text.
- const char* comment = ccg.GetComment();
- if (comment && *comment) {
- std::string echocmd = cmStrCat("echo ", comment);
+ if (cm::optional<std::string> comment = ccg.GetComment()) {
+ std::string echocmd = cmStrCat("echo ", *comment);
cmdLines.push_back(std::move(echocmd));
}