summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorChris Moeller <kode54@gmail.com>2012-07-19 21:59:13 -0700
committerGregory Maxwell <greg@xiph.org>2012-07-20 08:48:50 -0400
commitb768c9b0fd425a7651cf4c81cc7eb3f505701bb3 (patch)
treeaec6a143a017074da04542f88c5c0917fc73e27a /win32
parentde0b5324b687c9e9a33722d84151de08ee7f82a9 (diff)
downloadopus-b768c9b0fd425a7651cf4c81cc7eb3f505701bb3.tar.gz
Fixes MSVC projects and adds git version generator tool
Diffstat (limited to 'win32')
-rw-r--r--win32/config.h2
-rw-r--r--win32/genversion.bat17
2 files changed, 18 insertions, 1 deletions
diff --git a/win32/config.h b/win32/config.h
index f41dda32..4b8cb6da 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -19,6 +19,6 @@
#pragma warning(disable : 4996)/* This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. */
#endif
-#define OPUS_VERSION "0.9.11 win32"
+#include "version.h"
#endif CONFIG_H
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