Skip to content

Commit

Permalink
Merge pull request #166 from quink-black/fix-build-iconv
Browse files Browse the repository at this point in the history
Add libiconv dep to meson build again
  • Loading branch information
rockdaboot committed Jan 16, 2021
2 parents 44443ad + 5b63816 commit 99e7e6a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ libicu_dep = notfound
libidn_dep = notfound
libunistring = notfound
networking_deps = notfound
libiconv_dep = notfound

# FIXME: Cleanup this when Meson gets 'feature-combo':
# https://github.com/mesonbuild/meson/issues/4566
Expand Down Expand Up @@ -86,6 +87,19 @@ endif
if libidn2_dep.found() or libidn_dep.found()
# Check for libunistring, we need it for psl_str_to_utf8lower()
libunistring = cc.find_library('unistring')
found_iconv = false
if cc.has_function('iconv_open')
libiconv_dep = []
found_iconv = true
endif
if not found_iconv and cc.has_header_symbol('iconv.h', 'iconv_open')
libiconv_dep = [cc.find_library('iconv')]
found_iconv = true
endif

if not found_iconv
error('iconv implementation not found')
endif
endif

if host_machine.system() == 'windows'
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cargs = [
libpsl = library('psl', sources, suffixes_dafsa_h,
include_directories : [configinc, includedir],
c_args : cargs,
dependencies : [libidn2_dep, libidn_dep, libicu_dep, libunistring, networking_deps],
dependencies : [libidn2_dep, libidn_dep, libicu_dep, libunistring, networking_deps, libiconv_dep],
version: lt_version,
install: true,
)
Expand Down

0 comments on commit 99e7e6a

Please sign in to comment.