v2.0.0
Loading...
Searching...
No Matches
buildinfo.h File Reference

Compile-time helpers that capture the build date, time and git commit hash into the binary. More...

#include <cstring>
Include dependency graph for buildinfo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Functions

constexpr auto UTILSLIB::timeNowNow ()
constexpr auto UTILSLIB::dateToday ()
constexpr auto UTILSLIB::dateTimeNow ()
constexpr auto UTILSLIB::gitHash ()
constexpr auto UTILSLIB::gitHashLong ()

Detailed Description

Compile-time helpers that capture the build date, time and git commit hash into the binary.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2021-2026 MNE-CPP Authors

Author
Gabriel Motta gabri.nosp@m.elbe.nosp@m.nmott.nosp@m.a@gm.nosp@m.ail.c.nosp@m.om; Juan GPC jgarc.nosp@m.iapr.nosp@m.ieto@.nosp@m.mgh..nosp@m.harva.nosp@m.rd.e.nosp@m.du; Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
August 2021

Every accessor is a header-only constexpr function so the __DATE__ / __TIME__ macros and the MNE_GIT_HASH_* defines (injected by CMake at configure time) are evaluated in the translation unit that invokes them. The values are picked up by utils_global.cpp exactly once so every mne-cpp binary reports a single, stable build identifier in its About dialog, CLI --version banner, and crash logs.

When git metadata is unavailable (source tarball builds, shallow CI checkouts) the hash accessors return a constant sentinel string instead of failing the build.

Definition in file buildinfo.h.