On some architectures, atomic binutils are provided by the libatomic library from gcc. Linking with libatomic is therefore necessary, otherwise the build fails with: src/libcamera/4ab8042@@camera@sha/message.cpp.o: In function `libcamera::Message::registerMessageType()': message.cpp:(.text+0x178): undefined reference to `__atomic_fetch_add_4' collect2: error: ld returned 1 exit status This is often for example the case on sparc v8 32 bits. Fixes: - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> [Kieran: Updated commit message to refer to build failure on current master, rather than the old code currently built by buildroot] Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
128 lines
3.4 KiB
Meson
128 lines
3.4 KiB
Meson
libcamera_sources = files([
|
|
'bound_method.cpp',
|
|
'buffer.cpp',
|
|
'camera.cpp',
|
|
'camera_manager.cpp',
|
|
'camera_sensor.cpp',
|
|
'controls.cpp',
|
|
'device_enumerator.cpp',
|
|
'device_enumerator_sysfs.cpp',
|
|
'event_dispatcher.cpp',
|
|
'event_dispatcher_poll.cpp',
|
|
'event_notifier.cpp',
|
|
'formats.cpp',
|
|
'geometry.cpp',
|
|
'ipa_interface.cpp',
|
|
'ipa_manager.cpp',
|
|
'ipa_module.cpp',
|
|
'ipa_proxy.cpp',
|
|
'ipc_unixsocket.cpp',
|
|
'log.cpp',
|
|
'media_device.cpp',
|
|
'media_object.cpp',
|
|
'message.cpp',
|
|
'object.cpp',
|
|
'pipeline_handler.cpp',
|
|
'process.cpp',
|
|
'request.cpp',
|
|
'signal.cpp',
|
|
'stream.cpp',
|
|
'thread.cpp',
|
|
'timer.cpp',
|
|
'utils.cpp',
|
|
'v4l2_controls.cpp',
|
|
'v4l2_device.cpp',
|
|
'v4l2_subdevice.cpp',
|
|
'v4l2_videodevice.cpp',
|
|
])
|
|
|
|
libcamera_headers = files([
|
|
'include/camera_sensor.h',
|
|
'include/device_enumerator.h',
|
|
'include/device_enumerator_sysfs.h',
|
|
'include/device_enumerator_udev.h',
|
|
'include/event_dispatcher_poll.h',
|
|
'include/formats.h',
|
|
'include/ipa_manager.h',
|
|
'include/ipa_module.h',
|
|
'include/ipa_proxy.h',
|
|
'include/ipc_unixsocket.h',
|
|
'include/log.h',
|
|
'include/media_device.h',
|
|
'include/media_object.h',
|
|
'include/message.h',
|
|
'include/pipeline_handler.h',
|
|
'include/process.h',
|
|
'include/thread.h',
|
|
'include/utils.h',
|
|
'include/v4l2_device.h',
|
|
'include/v4l2_subdevice.h',
|
|
'include/v4l2_videodevice.h',
|
|
])
|
|
|
|
libcamera_internal_includes = include_directories('include')
|
|
|
|
includes = [
|
|
libcamera_includes,
|
|
libcamera_internal_includes,
|
|
]
|
|
|
|
subdir('pipeline')
|
|
subdir('proxy')
|
|
|
|
libudev = dependency('libudev', required : false)
|
|
|
|
if libudev.found()
|
|
config_h.set('HAVE_LIBUDEV', 1)
|
|
libcamera_sources += files([
|
|
'device_enumerator_udev.cpp',
|
|
])
|
|
endif
|
|
|
|
gen_controls = files('gen-controls.awk')
|
|
|
|
control_types_cpp = custom_target('control_types_cpp',
|
|
input : files('controls.cpp'),
|
|
output : 'control_types.cpp',
|
|
depend_files : gen_controls,
|
|
command : [gen_controls, '@INPUT@', '--code', '@OUTPUT@'])
|
|
|
|
libcamera_sources += control_types_cpp
|
|
|
|
gen_version = join_paths(meson.source_root(), 'utils', 'gen-version.sh')
|
|
|
|
version_cpp = vcs_tag(command : [gen_version, meson.build_root()],
|
|
input : 'version.cpp.in',
|
|
output : 'version.cpp',
|
|
fallback : meson.project_version())
|
|
|
|
libcamera_sources += version_cpp
|
|
|
|
libcamera_deps = [
|
|
cc.find_library('atomic', required: false),
|
|
cc.find_library('dl'),
|
|
libudev,
|
|
dependency('threads'),
|
|
]
|
|
|
|
libcamera_link_with = []
|
|
|
|
if get_option('android')
|
|
libcamera_sources += android_hal_sources
|
|
includes += android_includes
|
|
libcamera_link_with += android_camera_metadata
|
|
endif
|
|
|
|
libcamera = shared_library('camera',
|
|
libcamera_sources,
|
|
install : true,
|
|
link_with : libcamera_link_with,
|
|
include_directories : includes,
|
|
dependencies : libcamera_deps)
|
|
|
|
libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_h],
|
|
include_directories : libcamera_includes,
|
|
link_with : libcamera)
|
|
|
|
subdir('proxy/worker')
|