Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved issue #118 "Missing VERSION_INFO when compiling as Windows DLL" #120

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ test/iterate
test/case
test/custom
/tmp/
/build
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ set(SO_PATCH 1)

option(UTF8PROC_INSTALL "Enable installation of utf8proc" On)

add_library (utf8proc
set(UTF8PROC_FILES
utf8proc.c
utf8proc.h
)

if (BUILD_SHARED_LIBS AND MSVC)
set(UTF8PROC_WINDLL_SRCS
win32/utf8proc.rc
)
endif ()

add_library (utf8proc ${UTF8PROC_FILES} ${UTF8PROC_WINDLL_SRCS})

# expose header path, for when this is part of a larger cmake project
target_include_directories(utf8proc PUBLIC ../utf8proc)

Expand Down
1 change: 1 addition & 0 deletions utf8proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
/** The PATCH version (increased for fixes that do not change the API). */
#define UTF8PROC_VERSION_PATCH 0
/** @} */
#define UTF8PROC_VERSION_NUMBER "2.4.0\0"

#include <stdlib.h>

Expand Down
41 changes: 41 additions & 0 deletions win32/utf8proc.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <winver.h>
#include "../utf8proc.h"

#ifdef GCC_WINDRES
VS_VERSION_INFO VERSIONINFO
#else
VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
#endif
FILEVERSION UTF8PROC_VERSION_MAJOR,UTF8PROC_VERSION_MINOR,UTF8PROC_VERSION_PATCH,0
PRODUCTVERSION UTF8PROC_VERSION_MAJOR,UTF8PROC_VERSION_MINOR,UTF8PROC_VERSION_PATCH,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 "CompanyName", "JuliaStrings\0"
VALUE "FileDescription", "utf8proc library\0"
VALUE "FileVersion", UTF8PROC_VERSION_NUMBER
VALUE "InternalName", "utf8proc.dll\0"
VALUE "LegalCopyright", "(C) Jan Behrens and the rest of the Public Software Group\0"
VALUE "OriginalFilename", "utf8proc.dll\0"
VALUE "ProductName", "utf8proc\0"
VALUE "ProductVersion", UTF8PROC_VERSION_NUMBER
VALUE "Comments", "For more information visit https://github.com/JuliaStrings/utf8proc/\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END