This PR:
Switches to a modern CMake approach by using the
Python3::Interpreterimported target, which is more robust than using variables.Disables the
util_rpcauth_testtest explicitly instead of silently ignoring it.
A build and test log for the case when Python is unavailable is provided below:
$ cmake -B build
$ cmake --build build -j 16
$ ctest --test-dir build -j $(nproc) -R "^util"
Internal ctest changing into directory: /bitcoin/build
Test project /bitcoin/build
Start 115: util_tests
Start 117: util_trace_tests
Start 114: util_string_tests
Start 116: util_threadnames_tests
Start 1: util_rpcauth_test
1/5 Test [#1](/bitcoin-bitcoin/1/): util_rpcauth_test ................***Not Run (Disabled) 0.00 sec
2/5 Test [#114](/bitcoin-bitcoin/114/): util_string_tests ................ Passed 0.11 sec
3/5 Test [#117](/bitcoin-bitcoin/117/): util_trace_tests ................. Passed 0.11 sec
4/5 Test [#116](/bitcoin-bitcoin/116/): util_threadnames_tests ........... Passed 0.11 sec
5/5 Test [#115](/bitcoin-bitcoin/115/): util_tests ....................... Passed 0.13 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.13 sec
The following tests did not run:
1 - util_rpcauth_test (Disabled)