2017-12-29 17:12:55 +01:00
|
|
|
zeroconf_option = get_option('zeroconf')
|
|
|
|
|
2021-02-22 13:50:02 +01:00
|
|
|
avahi_dep = dependency('', required: false)
|
2017-12-29 17:12:55 +01:00
|
|
|
|
|
|
|
if zeroconf_option == 'auto'
|
|
|
|
if is_darwin
|
2021-01-23 12:06:49 +01:00
|
|
|
zeroconf_option = 'bonjour'
|
2017-12-29 17:12:55 +01:00
|
|
|
elif is_android or is_windows
|
|
|
|
zeroconf_option = 'disabled'
|
|
|
|
elif dbus_dep.found()
|
2021-02-22 13:50:02 +01:00
|
|
|
zeroconf_option = 'avahi'
|
2017-12-29 17:12:55 +01:00
|
|
|
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
|
2019-01-13 14:09:14 +01:00
|
|
|
|
2021-01-23 12:06:49 +01:00
|
|
|
bonjour_deps = [
|
|
|
|
log_dep,
|
|
|
|
]
|
|
|
|
|
|
|
|
if not is_darwin
|
|
|
|
bonjour_deps += declare_dependency(link_args: ['-ldns_sd'])
|
2019-01-13 14:09:14 +01:00
|
|
|
endif
|
2017-12-29 17:12:55 +01:00
|
|
|
conf.set('HAVE_BONJOUR', true)
|
2019-01-13 14:09:14 +01:00
|
|
|
|
2017-12-29 17:12:55 +01:00
|
|
|
zeroconf = static_library(
|
|
|
|
'zeroconf_bonjour',
|
2021-02-24 12:36:44 +01:00
|
|
|
'Glue.cxx',
|
|
|
|
'Bonjour.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
include_directories: inc,
|
2021-02-24 15:02:22 +01:00
|
|
|
dependencies: [
|
|
|
|
event_dep,
|
|
|
|
],
|
2017-12-29 17:12:55 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
zeroconf_dep = declare_dependency(
|
|
|
|
link_with: zeroconf,
|
2021-01-23 12:06:49 +01:00
|
|
|
dependencies: bonjour_deps,
|
2017-12-29 17:12:55 +01:00
|
|
|
)
|
|
|
|
else
|
2021-02-22 13:50:02 +01:00
|
|
|
subdir('avahi')
|
|
|
|
|
|
|
|
if not avahi_dep.found()
|
|
|
|
zeroconf_dep = dependency('', required: false)
|
|
|
|
subdir_done()
|
2017-12-29 17:12:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
conf.set('HAVE_AVAHI', true)
|
|
|
|
|
|
|
|
zeroconf = static_library(
|
|
|
|
'zeroconf_bonjour',
|
2021-02-24 12:36:44 +01:00
|
|
|
'Glue.cxx',
|
2017-12-29 17:12:55 +01:00
|
|
|
include_directories: inc,
|
|
|
|
dependencies: [
|
2021-02-22 13:50:02 +01:00
|
|
|
avahi_dep,
|
2017-12-29 17:12:55 +01:00
|
|
|
dbus_dep,
|
2019-05-08 16:11:14 +02:00
|
|
|
time_dep,
|
2020-01-18 19:45:56 +01:00
|
|
|
log_dep,
|
2017-12-29 17:12:55 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
zeroconf_dep = declare_dependency(
|
|
|
|
link_with: zeroconf,
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
conf.set('HAVE_ZEROCONF', true)
|