Fix version and commit display
Made version and commit variables static, and local to the version display function. Previously, they would be globals, and as such would collide with those from linked shared libraries. Now, all project types will have them local.
This commit is contained in:
parent
178b2f4860
commit
c83be332d5
@ -2,8 +2,8 @@ include premake.make
|
||||
|
||||
# git commit hash and version for this build
|
||||
COMMIT-HASH != git log 2>/dev/null | sed -e '1s/^commit //;q'
|
||||
COMMIT := "const char* commit = \"$(COMMIT-HASH)\";"
|
||||
VERSION := "const char* version = \"$(MAJOR).$(MINOR).$(PATCH)\";"
|
||||
COMMIT := "static const char* commit = \"$(COMMIT-HASH)\";"
|
||||
VERSION := "static const char* version = \"$(MAJOR).$(MINOR).$(PATCH)\";"
|
||||
|
||||
# some important install locations
|
||||
PREFIX ?= /usr/local
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "version.hpp"
|
||||
#include "version.inc"
|
||||
#include "commit.inc"
|
||||
#include <sstream>
|
||||
|
||||
std::string {PROJECT}_version() {
|
||||
#include "version.inc"
|
||||
#include "commit.inc"
|
||||
std::ostringstream oss;
|
||||
oss << "{PROJECT} version " << version;
|
||||
#ifdef DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user