mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 01:36:13 +00:00
Merge bitcoin/bitcoin#34605: build: define CMAKE_COMPILE_WARNING_AS_ERROR as a cache option
231dd04b8dcb85ed1bc9191b839fb6cd64acea86 build: define CMAKE_COMPILE_WARNING_AS_ERROR as a cache option (will) Pull request description: `CMAKE_COMPILE_WARNING_AS_ERROR` is not a cache variable by default in CMake, so it has no value in the configure summary when not set, and even when set cannot be toggled in `ccmake`. Define it as an `option()` to make it a cache BOOL with a default of OFF. From the original MR to cmake, this was deliberately not set as a cache variable: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7187 (see Brad King's reply to the collapsed comments from Marc Chevrier). Most `CMAKE_*` variables which are expected to be toggled by users are (as far as I can research) cache variables by default. Those that are considered likely to be set by the project (e.g. `CMAKE_CXX_STANDARD` or `CMAKE_POSITION_INDEPENDENT_CODE`) are not, along with read-only variables, script/internal variables, platform sppecific variables, template variables. `CMAKE_COMPILE_WARNING_AS_ERROR` may be a slight outlier here. I count ~ 600 documented CMAKE_* variables, of which ~ 60 are default cache variables. I could only see a few of these like: - CMAKE_COMPILE_WARNING_AS_ERROR - CMAKE_CXX_STANDARD, - CMAKE_POSITION_INDEPENDENT_CODE - CMAKE_INTERPROCEDURAL_OPTIMIZATION ...that we (or any project) _might_ want to expose as user-togglable, and would have to add as an `option()` in CMakeLists.txt. ACKs for top commit: ajtowns: Yeah, seems to work for me. ACK 231dd04b8dcb85ed1bc9191b839fb6cd64acea86 fanquake: ACK 231dd04b8dcb85ed1bc9191b839fb6cd64acea86 hebasto: ACK 231dd04b8dcb85ed1bc9191b839fb6cd64acea86, tested on Fedora 43. Tree-SHA512: e380d79188859c97a9f7e45215a789daff55b8bff945a3d61fe4de3daae54bb7196aca0f6a6f1165979e787238dc26e94d217cff35f9642031ff72f4b39655e1
This commit is contained in:
commit
ce6898f9a8
@ -119,6 +119,7 @@ endif()
|
||||
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)
|
||||
|
||||
option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF)
|
||||
option(CMAKE_COMPILE_WARNING_AS_ERROR "Treat compiler warnings as errors." OFF)
|
||||
option(WITH_CCACHE "Attempt to use ccache for compiling." ON)
|
||||
|
||||
option(WITH_ZMQ "Enable ZMQ notifications." OFF)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user