meson: wildmidi detection fixes

Need at least 0.4.2 apparently.

ext/wildmidi/meson.build:11:2: ERROR:  String '' cannot be converted to int
This commit is contained in:
Tim-Philipp Müller 2018-12-17 11:18:06 +00:00
parent d49bc71f00
commit a26cce1833

View file

@ -8,10 +8,14 @@ wildmidi_dep = dependency('WildMIDI', version: '>= 0.4.2', required: false)
if not wildmidi_dep.found() and cc.has_header ('wildmidi_lib.h')
wildmidi_ver_maj = cc.get_define('LIBWILDMIDI_VER_MAJOR', prefix: '#include <wildmidi_lib.h>')
wildmidi_ver_min = cc.get_define('LIBWILDMIDI_VER_MINOR', prefix: '#include <wildmidi_lib.h>')
wildmidi_ver_maj = ''.join(wildmidi_ver_maj.split('L')).to_int() # '0L' -> 0
wildmidi_ver_min = ''.join(wildmidi_ver_min.split('L')).to_int() # '4L' -> 4
if wildmidi_ver_maj == 0 and wildmidi_ver_min >= 4
wildmidi_dep = cc.find_library('WildMidi', required: false)
if wildmidi_ver_maj != '' and wildmidi_ver_min != ''
wildmidi_ver_maj = ''.join(wildmidi_ver_maj.split('L')).to_int() # '0L' -> 0
wildmidi_ver_min = ''.join(wildmidi_ver_min.split('L')).to_int() # '4L' -> 4
if wildmidi_ver_maj == 0 and wildmidi_ver_min >= 4
wildmidi_dep = cc.find_library('WildMidi', required: false)
else
message('WildMidi version too old, need >= 0.4.x')
endif
else
message('WildMidi version too old, need >= 0.4.x')
endif