Files
CMake/Tests/RunCMake/Ninja/CommentsWithDollars.cmake
Ben Boeckel 1bf48e34f4 Ninja: escape special characters in custom command comments
Considerations of Ninja's control sequences was not considered in
30fb5b1b22 (Ninja: add COMMENT to build statement descriptions,
2024-05-01) via !9484. Escape both newlines and dollar signs.

Fixes: #27181
2025-09-02 15:33:20 -04:00

12 lines
372 B
CMake

enable_language(C)
add_executable(comments_with_dollars hello.c)
add_custom_command(TARGET comments_with_dollars PRE_LINK
COMMAND "${CMAKE_COMMAND}" -E echo prelink
COMMENT "prelink with
\$dollars")
add_custom_command(TARGET comments_with_dollars POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E echo postbuild
COMMENT "postbuild with
\$dollars")