-
Notifications
You must be signed in to change notification settings - Fork 3
/
git-revision.h
42 lines (37 loc) · 1.26 KB
/
git-revision.h
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. See the enclosed file LICENSE for a copy or if
* that was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* Copyright 2017 Max H. Gerlach
*
* */
#ifndef GIT_REVISON_H_
#define GIT_REVISON_H_
extern const char GIT_BRANCH[];
extern const char GIT_REVISION_HASH[];
extern const char HOST_NAME[];
extern const char BUILD_DATE[];
extern const char BUILD_TIME[];
// extern const char CPPFLAGS[];
// extern const char CXXFLAGS[];
#include "metadata.h"
#include "tools.h"
inline MetadataMap collectVersionInfo() {
MetadataMap meta;
meta["gitBranch"] = numToString(GIT_BRANCH);
meta["gitRevisionHash"] = numToString(GIT_REVISION_HASH);
meta["buildHost"] = numToString(HOST_NAME);
meta["buildDate"] = numToString(BUILD_DATE);
meta["buildTime"] = numToString(BUILD_TIME);
// meta["cppflags"] = numToString(CPPFLAGS);
// meta["cxxflags"] = numToString(CXXFLAGS);
#ifdef BOOST_LIB_VERSION
meta["BOOST_LIB_VERSION"] = BOOST_LIB_VERSION;
#endif //BOOST_LIB_VERSION
#ifdef ARMA_VERSION_MAJOR
meta["ARMA_VERSION"] = arma::arma_version::as_string();
#endif //ARMA_VERSION_MAJOR
return meta;
}
#endif //GIT_REVISON_H_