cmake: Make `BUILD_KERNEL_TEST` depend on `BUILD_KERNEL_LIB`
What changed, and why it matters
This is a small CMake build-system change. It makes the optional test suite for an experimental library (BUILD_KERNEL_TEST) automatically disabled when the library itself (BUILD_KERNEL_LIB) is not being built. Previously, the test option could be left on independently, which could cause a build configuration error. There is no runtime security issue here.
No security action required. Treat as a normal build-system maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit replaces a plain option(BUILD_KERNEL_TEST ... ${BUILD_KERNEL_LIB}) with cmake_dependent_option(BUILD_KERNEL_TEST ... ON "BUILD_KERNEL_LIB" OFF). This ensures that BUILD_KERNEL_TEST is forced OFF unless BUILD_KERNEL_LIB is ON, preventing a configuration where kernel tests are requested but the kernel library is not built. It is a build-system correctness/robustness fix with no code-level security implications.
Changed components
CMakeLists.txt build configurationInspect captured patch +1 / −1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f264acc9..9e6c255d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,7 +105,7 @@ option(BUILD_UTIL "Build bitcoin-util executable." ${BUILD_TESTS})
option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF)
option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE})
-option(BUILD_KERNEL_TEST "Build tests for the experimental bitcoinkernel library." ${BUILD_KERNEL_LIB})
+cmake_dependent_option(BUILD_KERNEL_TEST "Build tests for the experimental bitcoinkernel library." ON "BUILD_KERNEL_LIB" OFF)
option(ENABLE_WALLET "Enable wallet." ON)
if(ENABLE_WALLET)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.