cmake: fix build of `t-oidtree`

When the `oidtree` test helper was turned into a unit test, a new `lib-oid` source file was added as dependency. This was only done in the Makefile so far, but also needs to be done in the CMake definition. This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c to unit-tests/t-oidtree.c, 2024-06-08). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jul 12, 2024 at 20:34 UTC 872721538c2612bd330f09423e465035882c4168
1 file changed +2 -1
contrib/buildsystems/CMakeLists.txt
+2 -1
@@ -976,11 +976,12 @@ list(TRANSFORM test-reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
976
977 #unit-tests
978 add_library(unit-test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)
979 +add_library(unit-test-lib-oid OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/lib-oid.c)
980
981 parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "")
982 foreach(unit_test ${unit_test_PROGRAMS})
983 add_executable("${unit_test}" "${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c")
983 - target_link_libraries("${unit_test}" unit-test-lib common-main)
984 + target_link_libraries("${unit_test}" unit-test-lib unit-test-lib-oid common-main)
985 set_target_properties("${unit_test}"
986 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
987 if(MSVC)