summaryrefslogtreecommitdiff
path: root/win32/genversion.bat
diff options
context:
space:
mode:
Diffstat (limited to 'win32/genversion.bat')
-rw-r--r--win32/genversion.bat17
1 files changed, 17 insertions, 0 deletions
diff --git a/win32/genversion.bat b/win32/genversion.bat
new file mode 100644
index 00000000..9bc6917f
--- /dev/null
+++ b/win32/genversion.bat
@@ -0,0 +1,17 @@
+@echo off
+
+for /f %%v in ('git describe --tags --match "v*"') do set version=%%v
+
+set version_out=#define %2 "%version%"
+
+echo %version_out% > %1_temp
+
+echo n | comp %1_temp %1 > NUL 2> NUL
+
+if not errorlevel 1 goto exit
+
+copy /y %1_temp %1
+
+:exit
+
+del %1_temp