From 02492a8a1f9627b003667dc1dcacafece46bcd1a Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Fri, 10 Mar 2023 10:51:26 +0100 Subject: [PATCH] cmake: Add dev-mode To use, invoke `cmake` with argument `--preset dev-mode`. One disadvantage over `./configure --enable-dev-mode` is that CMake does not provide a way to "hide" presets from users. That is, `cmake --list-presets` will list dev-mode, and it will also appear in `cmake-gui`, even though it's not selectable there due to a bug in cmake-gui. Solves one item in #1224. --- CMakePresets.json | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 CMakePresets.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000000..4216326701 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,31 @@ +// Pass `--preset ` to CMake to use a preset defined here. +// +// Presets are supported in CMake 3.19+. Unfortunately, older CMake versions +// may ignore the `--preset` argument silently. So if the preset is not picked +// up, make sure you have a recent CMake version. +// +// Note: JSON does not support comments officially, but CMake's JSON parser +// apparently ignores lines starting with "//" silently. +{ + "version": 3, + "configurePresets": [ + { + // Don't set "generator" here because developers should still be able to + // select their preferred generators. As a result we're affected by CMake + // bug https://gitlab.kitware.com/cmake/cmake/-/issues/23341, which means + // that dev-mode is not selectable in cmake-gui. But in our case, that's + // probably rather a feature than a bug. + "name": "dev-mode", + "displayName": "Development mode (intended only for developers of the library)", + "cacheVariables": { + "SECP256K1_EXPERIMENTAL": "ON", + "SECP256K1_ENABLE_MODULE_RECOVERY": "ON", + "SECP256K1_BUILD_EXAMPLES": "ON" + }, + "warnings": { + "dev": true, + "uninitialized": true + } + } + ] +}