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

Conversation

0ric1
Copy link

@0ric1 0ric1 commented Mar 1, 2018

This solves JuliaLang/utf8proc issue #118 "Missing VERSION_INFO when compiling as Windows DLL" using CMakeHelpsers from https://github.com/halex2005/CMakeHelpers. CMakeHelpers must be placed in the same directory as / parallel to utf8proc.
For English resource language you need to replace the following things in the CMakeHelpers/VersionResource.rc file:

FILEFLAGSMASK 0x3fL with FILEFLAGSMASK 0x17
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT with LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
BLOCK "041904b0 with BLOCK "040704b0"
VALUE "Translation", 0x419, 1200 with VALUE "Translation", 0x407, 1200

Andreas Schniertshauer added 3 commits September 11, 2017 21:07
…compiling as Windows DLL" using CMakeHelpsers from https://github.com/halex2005/CMakeHelpers. CMakeHelpers must be place in the same directory as / parallel to utf8proc.

For English resource language you need to replace the following things in the CMakeHelpers/VersionResource.rc file:

FILEFLAGSMASK 0x3fL                    with   FILEFLAGSMASK 0x17
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT with   LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
BLOCK "041904b0                        with   BLOCK "040704b0"
VALUE "Translation", 0x419, 1200       with   VALUE "Translation", 0x407, 1200
@stevengj
Copy link
Member

stevengj commented Mar 2, 2018

I don't like the idea of the build script depending on CMakeHelpers being installed in a particular directory outside the source tree.

CMakeHelpers is MIT-licensed, and https://github.com/halex2005/CMakeHelpers/blob/master/generate_product_version.cmake hasn't changed in 3 years. Maybe we should just include it in utf8proc?

@0ric1
Copy link
Author

0ric1 commented Mar 3, 2018

First I had the same idea to include CMakeHelpers in utf8proc but then I choose the parallel solution because this way I can use it for other projects too where the version info is needed and to be completely independent (no "copy/paste" code that needs to be merged when changes occur - especially important if more than one project uses CMakeHelpers). The CMakeLists.txt file checks if CMakeHelpers is installed and uses it to generate and add the version info or no version info is generated / added - as before.

@stevengj
Copy link
Member

stevengj commented Mar 8, 2018

Bundling a version that is known to work for utf8proc will be much less fragile.

lady mesh added 3 commits September 22, 2018 23:39
…32/utf8proc.rc file (subject to change) in case of BUILD_SHARED_LIBS AND MSVC.
… specify compile definitions for target "utf8proc" which is not built by this project.
@0ric1
Copy link
Author

0ric1 commented Sep 22, 2018

Because you don't like the idea of the build script depending on CMakeHelpers, but I need a version number for the DLL version of utf8proc for Windows I propose the following solution based on a win32/utf8proc.rc file that is only added in case of BUILD_SHARED_LIBS AND MSVC (see CMakeLists.txt) - this is nearly the same solution that zlib uses except zlib needs an entry (#define) in the header file (that is used in the .rc file) that I pass as definition UTF8PROC_VERSION to Visual Studio so the impact and duplicate code is lesser.

@0ric1
Copy link
Author

0ric1 commented May 16, 2019

I updated the VERSION_INFO to 2.4.0

CMakeLists.txt Outdated
set(SO_MINOR 3)
set(SO_PATCH 1)
set(SO_MINOR 4)
set(SO_PATCH 0)
Copy link
Member

@stevengj stevengj May 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the comment in the Makefile says, these numbers indicate ABI compatibility and don't follow the API version number exactly. From 2.3 to 2.4 there was no change in ABI which is why the minor version stayed 3.

Copy link
Member

@stevengj stevengj May 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's probably easier for us to just match the API number in the future so that we don't have this discussion repeatedly.

In any case, please don't update these now.

@0ric1
Copy link
Author

0ric1 commented Jul 18, 2019

I refactored the version info problem on Windows and removed the definitions from CMakeLists.txt and moved it to utf8proc.h where the UTF8PROC_VERSION_MAJOR, UTF8PROC_VERSION_MINOR and UTF8PROC_VERSION_PATCH is defined.

@0ric1
Copy link
Author

0ric1 commented Jul 31, 2019

Do you have any objects to this new solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants