[libcamera-devel] [PATCH] meson: Use library() in order to let user chose the library type
Christian Rauch
Rauch.Christian at gmx.de
Mon Nov 28 00:01:10 CET 2022
Defining libraries via shared_library() prevents compiling libcamera as
static library. The meson project recommends using library() instead of
shared_library(), static_library() or both_libraries():
https://mesonbuild.com/Reference-manual_functions.html#library
Signed-off-by: Christian Rauch <Rauch.Christian at gmx.de>
---
src/android/meson.build | 16 ++++++++--------
src/gstreamer/meson.build | 2 +-
src/libcamera/base/meson.build | 18 +++++++++---------
src/libcamera/meson.build | 18 +++++++++---------
src/v4l2/meson.build | 12 ++++++------
5 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/src/android/meson.build b/src/android/meson.build
index 1bba54de..51b365e3 100644
--- a/src/android/meson.build
+++ b/src/android/meson.build
@@ -67,11 +67,11 @@ android_camera_metadata = static_library('camera_metadata',
c_args : '-Wno-shadow',
include_directories : android_includes)
-libcamera_hal = shared_library('libcamera-hal',
- android_hal_sources,
- name_prefix : '',
- link_with : android_camera_metadata,
- install : true,
- cpp_args : android_cpp_args,
- include_directories : android_includes,
- dependencies : android_deps)
+libcamera_hal = library('libcamera-hal',
+ android_hal_sources,
+ name_prefix : '',
+ link_with : android_camera_metadata,
+ install : true,
+ cpp_args : android_cpp_args,
+ include_directories : android_includes,
+ dependencies : android_deps)
diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build
index eda246d7..b364837d 100644
--- a/src/gstreamer/meson.build
+++ b/src/gstreamer/meson.build
@@ -39,7 +39,7 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')
libcamera_gst_cpp_args += ['-Wno-unused-function']
endif
-libcamera_gst = shared_library('gstlibcamera',
+libcamera_gst = library('gstlibcamera',
libcamera_gst_sources,
cpp_args : libcamera_gst_cpp_args,
dependencies : [libcamera_private, gstvideo_dep, gstallocator_dep],
diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
index 7a7fd7e4..91dc1e71 100644
--- a/src/libcamera/base/meson.build
+++ b/src/libcamera/base/meson.build
@@ -48,15 +48,15 @@ libcamera_base_deps = [
# 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_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_lib = library('libcamera-base',
+ [libcamera_base_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,
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 0494e808..cd1bf4ed 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -163,15 +163,15 @@ libcamera_deps = [
# runtime if the library is running from an installed location by checking
# for the presence or abscence of the dynamic tag.
-libcamera = shared_library('libcamera',
- libcamera_sources,
- version : libcamera_version,
- soversion : libcamera_soversion,
- name_prefix : '',
- install : true,
- include_directories : includes,
- build_rpath : '/',
- dependencies : libcamera_deps)
+libcamera = library('libcamera',
+ libcamera_sources,
+ version : libcamera_version,
+ soversion : libcamera_soversion,
+ name_prefix : '',
+ install : true,
+ include_directories : includes,
+ build_rpath : '/',
+ dependencies : libcamera_deps)
libcamera_public = declare_dependency(sources : [
libcamera_ipa_headers,
diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
index f132103c..46dab168 100644
--- a/src/v4l2/meson.build
+++ b/src/v4l2/meson.build
@@ -27,12 +27,12 @@ v4l2_compat_cpp_args = [
'-fvisibility=hidden',
]
-v4l2_compat = shared_library('v4l2-compat',
- v4l2_compat_sources,
- name_prefix : '',
- install : true,
- dependencies : [libcamera_private, libdl],
- cpp_args : v4l2_compat_cpp_args)
+v4l2_compat = library('v4l2-compat',
+ v4l2_compat_sources,
+ name_prefix : '',
+ install : true,
+ dependencies : [libcamera_private, libdl],
+ cpp_args : v4l2_compat_cpp_args)
# Provide a wrapper script to support easily loading applications with the V4L2
# adaptation layer.
--
2.34.1
More information about the libcamera-devel
mailing list