-
Notifications
You must be signed in to change notification settings - Fork 16
/
version.cpp
53 lines (44 loc) · 1.15 KB
/
version.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (c) 2023 Team Dissolve and contributors
#include "main/version.h"
#include <fmt/format.h>
#define DISSOLVEVERSION "1.3.2"
#define DISSOLVESHORTHASH ""
#define DISSOLVEREPO "https://github.com/disorderedmaterials/dissolve.git"
namespace Version
{
// Return semantic version number
std::string_view semantic()
{
static std::string versionString = fmt::format("{}", DISSOLVEVERSION);
return versionString;
}
// Return current version information, including short hash if defined
std::string_view info()
{
static std::string versionString;
if (versionString.empty())
{
if (std::string_view(DISSOLVESHORTHASH).empty())
versionString = DISSOLVEVERSION;
else
versionString = fmt::format("{} @ {}", DISSOLVEVERSION, DISSOLVESHORTHASH);
}
return versionString;
}
// Return repo url
std::string_view repoUrl() { return DISSOLVEREPO; }
// Return app type
std::string_view appType()
{
#ifdef MULTITHREADING
#ifdef PARALLEL
return "MPI/Threads";
#else
return "Multithreaded";
#endif
#else
return "Serial";
#endif
}
}; // namespace Version