target_link_libraries: Configure time regression in 3.24
The "Configure" step time on this example:
cmake_minimum_required(VERSION 3.23)
project(Example C)
add_library(foo SHARED foo.c)
foreach(n RANGE 4000)
target_link_libraries(foo PUBLIC bar${n})
endforeach()
increased significantly from 3.23 to 3.24.
After the initial configuration of a new build tree, reconfiguring in 3.23 prints "Configuring Done" almost immediately, but in 3.24.1 there is a noticeable delay. The total configure/generate time in 3.24.1 is about 65% longer than in 3.23.3.