cmake: use verbatim arguments when invoking clar commands

Pass the VERBATIM option to `add_custom_command()`. Like this, all arguments to the commands will be escaped properly for the build tool so that the invoked command receives each argument unchanged. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Nov 15, 2024 at 08:32 UTC 8caa7b9b05a67da7cbcd7fe42725177cda9eae7c
1 file changed +4 -2
contrib/buildsystems/CMakeLists.txt
+4 -2
@@ -1009,13 +1009,15 @@ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
1009 "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
1010 ${clar_test_SUITES}
1011 DEPENDS ${CMAKE_SOURCE_DIR}/t/unit-tests/generate-clar-decls.sh
1012 - ${clar_test_SUITES})
1012 + ${clar_test_SUITES}
1013 + VERBATIM)
1014 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
1015 COMMAND ${SH_EXE} "${CMAKE_SOURCE_DIR}/t/unit-tests/generate-clar-suites.sh"
1016 "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
1017 "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
1018 DEPENDS "${CMAKE_SOURCE_DIR}/t/unit-tests/generate-clar-suites.sh"
1018 - "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h")
1019 + "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
1020 + VERBATIM)
1021
1022 add_library(unit-tests-lib ${clar_test_SUITES}
1023 "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c"