meson: add basic libiconv subproject functionality

This commit is contained in:
Ryan Lucia 2019-02-17 12:24:35 -05:00
parent 631dad170f
commit 9aeaceb6e7
2 changed files with 26 additions and 1 deletions

View file

@ -36,7 +36,13 @@ cxx = meson.get_compiler('cpp')
cc = meson.get_compiler('c')
deps += cc.find_library('m', required: false)
deps += cc.find_library('dl', required: false)
deps += cc.find_library('iconv', required: false)
iconv_dep = cc.find_library('iconv', required: false)
if not iconv_dep.found() and host_machine.system() == 'windows'
iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port
deps_inc += iconv_sp.get_variable('iconv_incs')
iconv_dep = iconv_sp.get_variable('libiconv_dep')
endif
deps += iconv_dep
deps += dependency('libass', version: '>=0.9.7')
deps += dependency('boost', version: '>=1.50.0',

View file

@ -0,0 +1,19 @@
project('iconv', 'c', license: 'LGPL',
meson_version: '>=0.49.0')
iconv_src = [
'libcharset/localcharset.c',
'libiconv/iconv.c'
]
iconv_headers = ['include/iconv.h']
iconv_incs = include_directories(
'include',
'libcharset',
'libiconv'
)
libiconv = library('iconv', iconv_src, include_directories: iconv_incs)
libiconv_dep = declare_dependency(link_with: libiconv,
include_directories: iconv_incs)