The CMake script in the test/kernel subdirectory is already gated by BUILD_KERNEL_LIB:https://github.com/bitcoin/bitcoin/blob/f6acbef1084e34f126bf530df99e4ef6a11c38e8/src/CMakeLists.txt#L405-L409
As a result, the following configuration summary is misleading:
0$ cmake -B build -DBUILD_KERNEL_LIB=OFF -DBUILD_KERNEL_TEST=ON
1<snip>
2 bitcoin-chainstate (experimental) ... OFF
3 libbitcoinkernel (experimental) ..... OFF
4 kernel-test (experimental) .......... ON
5<snip>
This PR fixes the behaviour by making the BUILD_KERNEL_TEST option explicitly depend on BUILD_KERNEL_LIB.