meson.build: Output DLL names similar to the MSVC projects

This makes the DLL names match those that are produced by the Visual
Studio projects by default.

This, currently, however, names the .lib files same as the ones that
are produced for other platforms (i.e. <libname>-3.lib).  This is
actually not that bad as one can just copy those .lib's into
<libname>-3.0.lib when needed and the binaries that link to those .lib's
ultimately link to the same DLLs, so this should not harm binary
compatibility.
This commit is contained in:
Chun-wei Fan 2019-04-04 10:15:27 +08:00 committed by Christoph Reiter
parent 33589f154e
commit 0432b22e02

View File

@ -81,7 +81,29 @@ gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version
cc = meson.get_compiler('c')
if cc.get_id() == 'msvc'
gtk_soversion = 'vs@0@'.format(cc.version().split('.')[0])
vsver = 0
mscver = cc.version().split('.')[0].to_int()
# pre-Visual Studio 2015 (18.xx.xxxxx or earlier): just subtract 6 from major
# version of cc.version() to get the Visual Studio version
if mscver < 19
vsver = mscver - 6
else
# Visual Studio 2015 and later (19.xx.xxxxx or later): look at the minor version.
# If minor version < 10: Visual Studio 2015,
# 10 < minor version < 20: Visual Studio 2017,
# 20 < minor version: Visual Studio 2019
mscsubver = cc.version().split('.')[1].to_int()
if mscsubver < 10
vsver = 14
elif mscsubver < 20
vsver = 15
else
vsver = 16
endif
endif
gtk_soversion = 'vs@0@'.format(vsver)
else
gtk_soversion = '0'
endif