diff --git a/sgminer.c b/sgminer.c index 391fbc08f..18bba5fb0 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 e778b6e47..e6b6ab221 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