include version information in git2.dll on Windows Signed-off-by: Sven Strickroth <email@cs-ware.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
diff --git a/.gitignore b/.gitignore
index 254e63d..87ba3f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ msvc/Release/
*.vc*proj*
*.sdf
*.opensdf
+*.aps
CMake*
*.cmake
.DS_Store
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2fad2d..aab897f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,7 +88,7 @@ FILE(GLOB SRC_H include/git2/*.h)
# On Windows use specific platform sources
IF (WIN32 AND NOT CYGWIN)
ADD_DEFINITIONS(-DWIN32 -D_DEBUG)
- FILE(GLOB SRC src/*.c src/win32/*.c)
+ FILE(GLOB SRC src/*.c src/win32/*.c src/win32/git2.rc)
ELSE()
FILE(GLOB SRC src/*.c src/unix/*.c)
ENDIF ()
diff --git a/src/win32/git2.rc b/src/win32/git2.rc
new file mode 100644
index 0000000..16a7b1f
--- /dev/null
+++ b/src/win32/git2.rc
@@ -0,0 +1,42 @@
+#include <winver.h>
+#include "../../include/git2/version.h"
+
+#ifndef INCLUDE_LIB
+#define LIBGIT2_FILENAME "git2.dll"
+#else
+#define LIBGIT2_FILENAME "libgit2.dll"
+#endif
+
+VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,0
+ PRODUCTVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+ FILEFLAGS 1
+#else
+ FILEFLAGS 0
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+ BEGIN
+ VALUE "FileDescription", "libgit2 - the Git linkable library\0"
+ VALUE "FileVersion", LIBGIT2_VERSION "\0"
+ VALUE "InternalName", LIBGIT2_FILENAME "\0"
+ VALUE "LegalCopyright", "Copyright (C) 2009-2011 the libgit2 contributors\0"
+ VALUE "OriginalFilename", LIBGIT2_FILENAME "\0"
+ VALUE "ProductName", "libgit2\0"
+ VALUE "ProductVersion", LIBGIT2_VERSION "\0"
+ VALUE "Comments", "For more information visit http://libgit2.github.com/\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END