Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Add dev-mode #1234

Merged

Commits on Apr 20, 2023

  1. cmake: Add dev-mode CMake preset

    To use, invoke `cmake` with argument `--preset dev-mode`.
    
    Solves one item in bitcoin-core#1235.
    
    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 bug
    https://gitlab.kitware.com/cmake/cmake/-/issues/23341. (So in our
    case, that's probably rather a feature than a bug.)
    
    We curently use version 3 presets which require CMake 3.21+.
    Unfortunately, CMake versions before 3.19 may ignore the `--preset`
    argument silently. So if the preset is not picked up, make sure you
    have a recent enough CMake version.
    
    More unfortunately, we can't even spell this warning out in
    CMakePresets.json because CMake does not support officially support
    comments in JSON, see
     - https://gitlab.kitware.com/cmake/cmake/-/issues/21858
     - https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5853 .
    We could use a hack hinted at in
    https://gitlab.kitware.com/cmake/cmake/-/issues/21858#note_908543
    but that's risky, because it could simply break for future versions,
    and we probably want to use presets not only for dev mode.
    real-or-random committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    0a446a3 View commit details
    Browse the repository at this point in the history
  2. gitignore: Add CMakeUserPresets.json

    This file is specifically intended for *local* CMake templates
    (as opposed to CMakePresets.json).
    real-or-random committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    ce5ba9e View commit details
    Browse the repository at this point in the history