While optional, libunwind integration is enabled when meson finds it without having a way to disable it. This is the case for Debian where libunwind is installed by build dependencies. Since we want to reduce dependencies on libunwind in Debian due to several issues with it[0], we need an option to control its activation. [0]: https://bugs.debian.org/1093688 Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Longer commit message lines, reworded meson option description.] Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
82 lines
2.5 KiB
Meson
82 lines
2.5 KiB
Meson
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
libcamera_base_public_sources = files([
|
|
'bound_method.cpp',
|
|
'class.cpp',
|
|
'flags.cpp',
|
|
'object.cpp',
|
|
'shared_fd.cpp',
|
|
'signal.cpp',
|
|
'unique_fd.cpp',
|
|
])
|
|
|
|
libcamera_base_internal_sources = files([
|
|
'backtrace.cpp',
|
|
'event_dispatcher.cpp',
|
|
'event_dispatcher_poll.cpp',
|
|
'event_notifier.cpp',
|
|
'file.cpp',
|
|
'log.cpp',
|
|
'memfd.cpp',
|
|
'message.cpp',
|
|
'mutex.cpp',
|
|
'semaphore.cpp',
|
|
'thread.cpp',
|
|
'timer.cpp',
|
|
'utils.cpp',
|
|
])
|
|
|
|
libdw = dependency('libdw', required : false)
|
|
libunwind = dependency('libunwind', required : get_option('libunwind'))
|
|
|
|
if cc.has_header_symbol('execinfo.h', 'backtrace')
|
|
config_h.set('HAVE_BACKTRACE', 1)
|
|
endif
|
|
|
|
if libdw.found()
|
|
config_h.set('HAVE_DW', 1)
|
|
endif
|
|
|
|
if libunwind.found()
|
|
config_h.set('HAVE_UNWIND', 1)
|
|
endif
|
|
|
|
libcamera_base_deps = [
|
|
libatomic,
|
|
libdw,
|
|
libthreads,
|
|
libunwind,
|
|
]
|
|
|
|
# Internal components must use the libcamera_base_private dependency to enable
|
|
# the use of headers which must not be exposed to the libcamera public api.
|
|
libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]
|
|
|
|
libcamera_base_lib = shared_library('libcamera-base',
|
|
[
|
|
libcamera_base_public_sources,
|
|
libcamera_base_internal_sources,
|
|
libcamera_base_headers,
|
|
],
|
|
version : libcamera_version,
|
|
soversion : libcamera_soversion,
|
|
name_prefix : '',
|
|
install : true,
|
|
cpp_args : libcamera_base_args,
|
|
include_directories : libcamera_includes,
|
|
dependencies : libcamera_base_deps)
|
|
|
|
libcamera_base = declare_dependency(sources : [
|
|
libcamera_base_headers,
|
|
],
|
|
include_directories : libcamera_includes,
|
|
link_with : libcamera_base_lib)
|
|
|
|
pkg_mod = import('pkgconfig')
|
|
pkg_mod.generate(libcamera_base_lib,
|
|
description : 'Camera support base utility library',
|
|
subdirs : 'libcamera')
|
|
|
|
libcamera_base_private = declare_dependency(dependencies : libcamera_base,
|
|
compile_args : libcamera_base_args)
|