Skip to content

Commit 02492a8

Browse files
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 bitcoin-core#1224.
1 parent 5658209 commit 02492a8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CMakePresets.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Pass `--preset <name>` to CMake to use a preset defined here.
2+
//
3+
// Presets are supported in CMake 3.19+. Unfortunately, older CMake versions
4+
// may ignore the `--preset` argument silently. So if the preset is not picked
5+
// up, make sure you have a recent CMake version.
6+
//
7+
// Note: JSON does not support comments officially, but CMake's JSON parser
8+
// apparently ignores lines starting with "//" silently.
9+
{
10+
"version": 3,
11+
"configurePresets": [
12+
{
13+
// Don't set "generator" here because developers should still be able to
14+
// select their preferred generators. As a result we're affected by CMake
15+
// bug https://gitlab.kitware.com/cmake/cmake/-/issues/23341, which means
16+
// that dev-mode is not selectable in cmake-gui. But in our case, that's
17+
// probably rather a feature than a bug.
18+
"name": "dev-mode",
19+
"displayName": "Development mode (intended only for developers of the library)",
20+
"cacheVariables": {
21+
"SECP256K1_EXPERIMENTAL": "ON",
22+
"SECP256K1_ENABLE_MODULE_RECOVERY": "ON",
23+
"SECP256K1_BUILD_EXAMPLES": "ON"
24+
},
25+
"warnings": {
26+
"dev": true,
27+
"uninitialized": true
28+
}
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)