summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorPeter Würth <wuerth.peter@freenet.de>2022-11-17 11:12:26 (GMT)
committerPeter Würth <wuerth.peter@freenet.de>2022-11-19 12:32:56 (GMT)
commit60a5a39022c8c2504173d635732110b2550b7f91 (patch)
treefa0ef8f4a0512f483200d526a0b2c205e5857b37 /Source/cmLocalUnixMakefileGenerator3.cxx
parentd8c8e61633328b4e2247ce381e22ddc71dd0fbbf (diff)
downloadCMake-60a5a39022c8c2504173d635732110b2550b7f91.zip
CMake-60a5a39022c8c2504173d635732110b2550b7f91.tar.gz
CMake-60a5a39022c8c2504173d635732110b2550b7f91.tar.bz2
cmCustomCommandGenerator: refactor GetComment to return std::string
Refactoring was done because EvaluateComment leaked memory.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index de1d3cd..7172d34 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -10,6 +10,7 @@
#include <utility>
#include <cm/memory>
+#include <cm/optional>
#include <cm/string_view>
#include <cm/vector>
#include <cmext/algorithm>
@@ -945,9 +946,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
// post-build command comments. Custom build step commands have
// their comments generated elsewhere.
if (echo_comment) {
- const char* comment = ccg.GetComment();
- if (comment && *comment) {
- this->AppendEcho(commands, comment,
+ if (cm::optional<std::string> comment = ccg.GetComment()) {
+ this->AppendEcho(commands, *comment,
cmLocalUnixMakefileGenerator3::EchoGenerate);
}
}