meson: add a temporary workaround for iconv crap

The initial iconv dependency worked everywhere but was broken on
freebsd. This was fixed in 0.60.2 but the fix accidentally broke mingw
(ouch; kind of my fault for not double checking). There's another PR to
fix this but that won't land until 0.60.3 so for the meantime just
if/else this (both freebsd and windows work with the system method)
until we want to bump the meson version (probably not for a while since
opensuse tumbleweed is weirdly slow).
This commit is contained in:
Dudemanguy 2021-11-25 22:07:40 -06:00
parent 51da9d257e
commit ec97b3f279
1 changed files with 9 additions and 7 deletions

View File

@ -639,14 +639,16 @@ if dvdnav.found() and dvdread.found()
sources += files('stream/stream_dvdnav.c')
endif
iconv = dependency('iconv', required: get_option('iconv'))
#TODO: remove this crap one day.
#Freebsd requires 0.60.2 or up to work without specifying the method.
#Windows breaks on exactly 0.60.2 (will have to wait for 0.60.3).
if host_machine.system() == 'freebsd' or host_machine.system() == 'windows'
iconv_method = 'system'
else
iconv_method = 'auto'
endif
iconv = dependency('iconv', method: iconv_method, required: get_option('iconv'))
if iconv.found()
# It is possible for FreeBSD to also have GNU's libiconv installed.
# We don't need this since mpv does not use any GNU-specific features.
# Get iconv via the system method instead in this case.
if host_machine.system() == 'freebsd'
iconv = dependency('iconv', method: 'system')
endif
dependencies += iconv
features += 'iconv'
endif