cmake: rename clar-related variables to avoid confusion
In c3de556a841f (Makefile: rename clar-related variables to avoid confusion, 2024-09-10) some `Makefile` variables were renamed that were partially used by the CMake definition. Adapt the latter to the new lay of the land. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Sep 18, 2024 at 19:21 UTC
77c6bd9f38c96a568d851beef185aeb9930de7b4
1 file changed
+6
-6
contrib/buildsystems/CMakeLists.txt
+6
-6
@@ -1004,14 +1004,14 @@ foreach(unit_test ${unit_test_PROGRAMS})
1004
endif()
1005
endforeach()
1006
1007
-parse_makefile_for_scripts(unit_tests_SUITES "UNIT_TESTS_SUITES" "")
1007
+parse_makefile_for_scripts(clar_test_SUITES "CLAR_TEST_SUITES" "")
1008
1009
set(clar_decls "")
1010
set(clar_cbs "")
1011
set(clar_cbs_count 0)
1012
set(clar_suites "static struct clar_suite _clar_suites[] = {\n")
1013
-list(LENGTH unit_tests_SUITES clar_suites_count)
1014
-foreach(suite ${unit_tests_SUITES})
1013
+list(LENGTH clar_test_SUITES clar_suites_count)
1014
+foreach(suite ${clar_test_SUITES})
1015
file(STRINGS "${CMAKE_SOURCE_DIR}/t/unit-tests/${suite}.c" decls
1016
REGEX "^void test_${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*\\(void\\)$")
1017
@@ -1042,9 +1042,9 @@ string(APPEND clar_suites
1042
file(WRITE "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h" "${clar_decls}")
1043
file(WRITE "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite" "${clar_decls}" "${clar_cbs}" "${clar_suites}")
1044
1045
-list(TRANSFORM unit_tests_SUITES PREPEND "${CMAKE_SOURCE_DIR}/t/unit-tests/")
1046
-list(TRANSFORM unit_tests_SUITES APPEND ".c")
1047
-add_library(unit-tests-lib ${unit_tests_SUITES} "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c")
1045
+list(TRANSFORM clar_test_SUITES PREPEND "${CMAKE_SOURCE_DIR}/t/unit-tests/")
1046
+list(TRANSFORM clar_test_SUITES APPEND ".c")
1047
+add_library(unit-tests-lib ${clar_test_SUITES} "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c")
1048
target_include_directories(unit-tests-lib PRIVATE "${CMAKE_SOURCE_DIR}/t/unit-tests")
1049
add_executable(unit-tests "${CMAKE_SOURCE_DIR}/t/unit-tests/unit-test.c")
1050
target_link_libraries(unit-tests unit-tests-lib common-main)