diff options
author | Peter Würth <wuerth.peter@freenet.de> | 2022-11-17 11:12:26 (GMT) |
---|---|---|
committer | Peter Würth <wuerth.peter@freenet.de> | 2022-11-19 12:32:56 (GMT) |
commit | 60a5a39022c8c2504173d635732110b2550b7f91 (patch) | |
tree | fa0ef8f4a0512f483200d526a0b2c205e5857b37 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | d8c8e61633328b4e2247ce381e22ddc71dd0fbbf (diff) | |
download | CMake-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.cxx | 6 |
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); } } |