Skip to content

Commit 6053616

Browse files
authored
Merge pull request libgit2#5561 from A-Ovchinnikov-mx/a-ovchin/windres-rc
Enable building git2.rc resource script with GCC
2 parents 8720ae8 + dc1deb3 commit 6053616

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ list(SORT SRC_H)
278278

279279
# On Windows use specific platform sources
280280
if(WIN32 AND NOT CYGWIN)
281-
if(MSVC)
282-
SET(WIN_RC "win32/git2.rc")
283-
endif()
281+
SET(WIN_RC "win32/git2.rc")
284282

285283
file(GLOB SRC_OS win32/*.c win32/*.h)
286284
list(SORT SRC_OS)

src/win32/git2.rc

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,29 @@
22
#include "../../include/git2/version.h"
33

44
#ifndef LIBGIT2_FILENAME
5-
# define LIBGIT2_FILENAME "git2"
5+
# ifdef __GNUC__
6+
# define LIBGIT2_FILENAME git2
7+
# else
8+
# define LIBGIT2_FILENAME "git2"
9+
# endif
610
#endif
711

812
#ifndef LIBGIT2_COMMENTS
913
# define LIBGIT2_COMMENTS "For more information visit http://libgit2.github.com/"
1014
#endif
1115

16+
#ifdef __GNUC__
17+
# define _STR(x) #x
18+
# define STR(x) _STR(x)
19+
#else
20+
# define STR(x) x
21+
#endif
22+
23+
#ifdef __GNUC__
24+
VS_VERSION_INFO VERSIONINFO
25+
#else
1226
VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
27+
#endif
1328
FILEVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,LIBGIT2_VER_PATCH
1429
PRODUCTVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,LIBGIT2_VER_PATCH
1530
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
@@ -29,9 +44,9 @@ BEGIN
2944
BEGIN
3045
VALUE "FileDescription", "libgit2 - the Git linkable library\0"
3146
VALUE "FileVersion", LIBGIT2_VERSION "\0"
32-
VALUE "InternalName", LIBGIT2_FILENAME ".dll\0"
47+
VALUE "InternalName", STR(LIBGIT2_FILENAME) ".dll\0"
3348
VALUE "LegalCopyright", "Copyright (C) the libgit2 contributors. All rights reserved.\0"
34-
VALUE "OriginalFilename", LIBGIT2_FILENAME ".dll\0"
49+
VALUE "OriginalFilename", STR(LIBGIT2_FILENAME) ".dll\0"
3550
VALUE "ProductName", "libgit2\0"
3651
VALUE "ProductVersion", LIBGIT2_VERSION "\0"
3752
VALUE "Comments", LIBGIT2_COMMENTS "\0"

0 commit comments

Comments
 (0)