Skip to content

Commit 3864d43

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 #1224.
1 parent 5658209 commit 3864d43

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

CMakePresets.json

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

0 commit comments

Comments
 (0)