Files
mkproj/tpl/version.cpp
T
bob 62a89679f0 Change build date to commit date in version string
Use build date only when there is no commit.
2026-10-30 12:48:51 +01:00

21 lines
443 B
C++

#include "version.hpp"
#include <sstream>
std::string {PROJECT}_version() {
#include "version.inc"
#include "commit.inc"
std::ostringstream oss;
oss << "{PROJECT} version " << version;
#ifdef DEBUG
oss << " DEBUG";
#endif
oss << '\n';
if (commit[0] != '\0') {
oss << "build " << commit << '\n';
} else {
oss << __DATE__ << ", " << __TIME__ << '\n';
}
oss << "(c) Bob Polis, all rights reserved";
return oss.str();
}