mpd/src/zeroconf/meson.build

78 lines
1.4 KiB
Meson
Raw Normal View History

zeroconf_option = get_option('zeroconf')
2021-02-22 13:50:02 +01:00
avahi_dep = dependency('', required: false)
if zeroconf_option == 'auto'
if is_darwin
zeroconf_option = 'bonjour'
elif is_android or is_windows
zeroconf_option = 'disabled'
elif dbus_dep.found()
2021-02-22 13:50:02 +01:00
zeroconf_option = 'avahi'
else
zeroconf_option = 'disabled'
endif
endif
if zeroconf_option == 'disabled'
zeroconf_dep = dependency('', required: false)
subdir_done()
endif
if zeroconf_option == 'bonjour'
if not compiler.has_header('dns_sd.h')
error('dns_sd.h not found')
endif
bonjour_deps = [
log_dep,
]
if not is_darwin
bonjour_deps += declare_dependency(link_args: ['-ldns_sd'])
endif
conf.set('HAVE_BONJOUR', true)
zeroconf = static_library(
'zeroconf_bonjour',
'Glue.cxx',
'Bonjour.cxx',
include_directories: inc,
2021-02-24 15:02:22 +01:00
dependencies: [
event_dep,
],
)
zeroconf_dep = declare_dependency(
link_with: zeroconf,
dependencies: bonjour_deps,
)
else
2021-02-22 13:50:02 +01:00
subdir('avahi')
if not avahi_dep.found()
zeroconf_dep = dependency('', required: false)
subdir_done()
endif
conf.set('HAVE_AVAHI', true)
zeroconf = static_library(
'zeroconf_bonjour',
'Glue.cxx',
include_directories: inc,
dependencies: [
2021-02-22 13:50:02 +01:00
avahi_dep,
dbus_dep,
time_dep,
log_dep,
],
)
zeroconf_dep = declare_dependency(
link_with: zeroconf,
)
endif
conf.set('HAVE_ZEROCONF', true)