From ba9818a7071b0ec45e61f4a037dfc1f8eafddb3c Mon Sep 17 00:00:00 2001 From: troky Date: Sun, 16 Nov 2014 19:52:30 +0100 Subject: [PATCH] Fix version display in windows builds (mingw) --- sgminer.c | 2 +- winbuild/sgminer.vcxproj | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sgminer.c b/sgminer.c index 391fbc08..18bba5fb 100644 --- a/sgminer.c +++ b/sgminer.c @@ -66,7 +66,7 @@ char *curly = ":D"; #include #endif -#ifdef GIT_VERSION +#if defined(USE_GIT_VERSION) && defined(GIT_VERSION) #undef VERSION #define VERSION GIT_VERSION #endif diff --git a/winbuild/sgminer.vcxproj b/winbuild/sgminer.vcxproj index e778b6e4..e6b6ab22 100644 --- a/winbuild/sgminer.vcxproj +++ b/winbuild/sgminer.vcxproj @@ -123,8 +123,8 @@ del /f "$(OutDir)*.exe" del /f "$(OutDir)*.dll" - type nul > "$(ProjectDir)dist\include\gitversion.h" - FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" > "$(ProjectDir)dist\include\gitversion.h" + echo #define USE_GIT_VERSION 1 > "$(ProjectDir)dist\include\gitversion.h" + FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" >> "$(ProjectDir)dist\include\gitversion.h" exit 0 @@ -165,8 +165,8 @@ del /f "$(OutDir)*.exe" del /f "$(OutDir)*.dll" - type nul > "$(ProjectDir)dist\include\gitversion.h" - FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" > "$(ProjectDir)dist\include\gitversion.h" + echo #define USE_GIT_VERSION 1 > "$(ProjectDir)dist\include\gitversion.h" + FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" >> "$(ProjectDir)dist\include\gitversion.h" exit 0 @@ -208,8 +208,8 @@ del /f "$(OutDir)*.exe" del /f "$(OutDir)*.dll" - type nul > "$(ProjectDir)dist\include\gitversion.h" - FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" > "$(ProjectDir)dist\include\gitversion.h" + echo #define USE_GIT_VERSION 1 > "$(ProjectDir)dist\include\gitversion.h" + FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" >> "$(ProjectDir)dist\include\gitversion.h" exit 0 @@ -252,8 +252,8 @@ del /f "$(OutDir)*.exe" del /f "$(OutDir)*.dll" - type nul > "$(ProjectDir)dist\include\gitversion.h" - FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" > "$(ProjectDir)dist\include\gitversion.h" + echo #define USE_GIT_VERSION 1 > "$(ProjectDir)dist\include\gitversion.h" + FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" >> "$(ProjectDir)dist\include\gitversion.h" exit 0