add git derived version info
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
add_executable(db ${DB_SOURCES})
|
||||
|
||||
target_compile_definitions(db PRIVATE GIT_DESCRIBE="${GIT_DESCRIBE_VERSION}")
|
||||
|
||||
target_link_libraries(db
|
||||
common
|
||||
libgame
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef GIT_DESCRIBE
|
||||
#define GIT_DESCRIBE "unknown"
|
||||
#endif
|
||||
|
||||
void WriteVersion()
|
||||
{
|
||||
#ifndef OS_WINDOWS
|
||||
@@ -8,7 +12,7 @@ void WriteVersion()
|
||||
|
||||
if (NULL != fp)
|
||||
{
|
||||
fprintf(fp, "db revision: %s\n", __P4_VERSION__);
|
||||
fprintf(fp, "db revision: %s\n", GIT_DESCRIBE);
|
||||
//fprintf(fp, "%s@%s:%s\n", __USER__, __HOSTNAME__, __PWD__);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
add_executable(game ${GAME_SOURCES})
|
||||
|
||||
target_compile_definitions(game PRIVATE GIT_DESCRIBE="${GIT_DESCRIBE_VERSION}")
|
||||
|
||||
target_link_libraries(game
|
||||
common
|
||||
libgame
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef GIT_DESCRIBE_VERSION
|
||||
#define GIT_DESCRIBE_VERSION "unknown"
|
||||
#endif
|
||||
|
||||
void WriteVersion()
|
||||
{
|
||||
#ifndef OS_WINDOWS
|
||||
@@ -7,7 +11,7 @@ void WriteVersion()
|
||||
|
||||
if (fp)
|
||||
{
|
||||
fprintf(fp, "game revision: 40250");
|
||||
fprintf(fp, "game revision: %s\n", GIT_DESCRIBE_VERSION);
|
||||
//fprintf(fp, "game revision: %s\n", __SVN_VERSION__);
|
||||
//fprintf(fp, "%s@%s:%s\n", __USER__, __HOSTNAME__, __PWD__);
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user