Skip to content

Commit 62893db

Browse files
committed
expat: add version file support
1 parent ca39d6d commit 62893db

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

subprojects/packagefiles/expat/meson.build

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ project(
2424
'c',
2525
license: 'MIT',
2626
version: '2.7.3',
27-
meson_version: '>= 0.54.1',
27+
meson_version: '>= 0.58',
2828
)
2929

30+
dllver = '1.11.1'
31+
3032
config = configuration_data()
3133
cc = meson.get_compiler('c')
3234

@@ -164,6 +166,15 @@ if host_machine.system() == 'windows'
164166
)
165167
expat_static_args += '-DXML_STATIC'
166168
endif
169+
170+
vard = configuration_data()
171+
vard.set('PROJECT_VERSION', meson.project_version())
172+
verf = configure_file(
173+
configuration: vard,
174+
format: 'cmake',
175+
input: 'win32/version.rc.cmake',
176+
output: 'version.rc',
177+
)
167178
else
168179
add_project_arguments(
169180
'-DXMLIMPORT=__attribute__ ((visibility("default")))',
@@ -197,14 +208,23 @@ dfile = configure_file(
197208

198209
incdir = include_directories('lib')
199210

211+
sources = files('lib/xmlparse.c', 'lib/xmlrole.c', 'lib/xmltok.c')
212+
213+
if host_machine.system() == 'windows'
214+
sources += import('windows').compile_resources(
215+
verf,
216+
args: '-DVER_FILEVERSION=@0@,0'.format(
217+
meson.project_version().replace('.', ','),
218+
),
219+
)
220+
endif
221+
200222
libexpat = library(
201223
'expat',
202-
'lib/xmlparse.c',
203-
'lib/xmlrole.c',
204-
'lib/xmltok.c',
224+
sources,
205225
include_directories: incdir,
206226
dependencies: dep_libbsd,
207-
version: '1.11.1',
227+
version: dllver,
208228
soversion: host_machine.system() != 'windows' ? '1' : '',
209229
vs_module_defs: dfile,
210230
install: true,

0 commit comments

Comments
 (0)