@@ -24,9 +24,11 @@ project(
24
24
' c' ,
25
25
license : ' MIT' ,
26
26
version : ' 2.7.3' ,
27
- meson_version : ' >= 0.54.1 ' ,
27
+ meson_version : ' >= 0.58 ' ,
28
28
)
29
29
30
+ dllver = ' 1.11.1'
31
+
30
32
config = configuration_data ()
31
33
cc = meson .get_compiler(' c' )
32
34
@@ -164,6 +166,15 @@ if host_machine.system() == 'windows'
164
166
)
165
167
expat_static_args += ' -DXML_STATIC'
166
168
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
+ )
167
178
else
168
179
add_project_arguments (
169
180
' -DXMLIMPORT=__attribute__ ((visibility("default")))' ,
@@ -197,14 +208,23 @@ dfile = configure_file(
197
208
198
209
incdir = include_directories (' lib' )
199
210
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
+
200
222
libexpat = library (
201
223
' expat' ,
202
- ' lib/xmlparse.c' ,
203
- ' lib/xmlrole.c' ,
204
- ' lib/xmltok.c' ,
224
+ sources,
205
225
include_directories : incdir,
206
226
dependencies : dep_libbsd,
207
- version : ' 1.11.1 ' ,
227
+ version : dllver ,
208
228
soversion : host_machine .system() != ' windows' ? ' 1' : '' ,
209
229
vs_module_defs : dfile,
210
230
install : true ,
0 commit comments