Browse Source

Fix version display in windows builds (mingw)

djm34
troky 10 years ago
parent
commit
ba9818a707
  1. 2
      sgminer.c
  2. 16
      winbuild/sgminer.vcxproj

2
sgminer.c

@ -66,7 +66,7 @@ char *curly = ":D";
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#ifdef GIT_VERSION #if defined(USE_GIT_VERSION) && defined(GIT_VERSION)
#undef VERSION #undef VERSION
#define VERSION GIT_VERSION #define VERSION GIT_VERSION
#endif #endif

16
winbuild/sgminer.vcxproj

@ -123,8 +123,8 @@
del /f "$(OutDir)*.exe" del /f "$(OutDir)*.exe"
del /f "$(OutDir)*.dll" del /f "$(OutDir)*.dll"
type nul &gt; "$(ProjectDir)dist\include\gitversion.h" echo #define USE_GIT_VERSION 1 &gt; "$(ProjectDir)dist\include\gitversion.h"
FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt; "$(ProjectDir)dist\include\gitversion.h" FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt;&gt; "$(ProjectDir)dist\include\gitversion.h"
exit 0 exit 0
</Command> </Command>
</PreBuildEvent> </PreBuildEvent>
@ -165,8 +165,8 @@
del /f "$(OutDir)*.exe" del /f "$(OutDir)*.exe"
del /f "$(OutDir)*.dll" del /f "$(OutDir)*.dll"
type nul &gt; "$(ProjectDir)dist\include\gitversion.h" echo #define USE_GIT_VERSION 1 &gt; "$(ProjectDir)dist\include\gitversion.h"
FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt; "$(ProjectDir)dist\include\gitversion.h" FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt;&gt; "$(ProjectDir)dist\include\gitversion.h"
exit 0 exit 0
</Command> </Command>
</PreBuildEvent> </PreBuildEvent>
@ -208,8 +208,8 @@
del /f "$(OutDir)*.exe" del /f "$(OutDir)*.exe"
del /f "$(OutDir)*.dll" del /f "$(OutDir)*.dll"
type nul &gt; "$(ProjectDir)dist\include\gitversion.h" echo #define USE_GIT_VERSION 1 &gt; "$(ProjectDir)dist\include\gitversion.h"
FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt; "$(ProjectDir)dist\include\gitversion.h" FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt;&gt; "$(ProjectDir)dist\include\gitversion.h"
exit 0 exit 0
</Command> </Command>
</PreBuildEvent> </PreBuildEvent>
@ -252,8 +252,8 @@
del /f "$(OutDir)*.exe" del /f "$(OutDir)*.exe"
del /f "$(OutDir)*.dll" del /f "$(OutDir)*.dll"
type nul &gt; "$(ProjectDir)dist\include\gitversion.h" echo #define USE_GIT_VERSION 1 &gt; "$(ProjectDir)dist\include\gitversion.h"
FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt; "$(ProjectDir)dist\include\gitversion.h" FOR /F "tokens=*" %%i IN ('call git describe "--abbrev=4" --dirty') DO echo #define GIT_VERSION "%%i" &gt;&gt; "$(ProjectDir)dist\include\gitversion.h"
exit 0 exit 0
</Command> </Command>
</PreBuildEvent> </PreBuildEvent>

Loading…
Cancel
Save