[v1] meson: Add `libdw` option to control libdw dependency
diff mbox series

Message ID 20260130090819.1511202-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [v1] meson: Add `libdw` option to control libdw dependency
Related show

Commit Message

Barnabás Pőcze Jan. 30, 2026, 9:08 a.m. UTC
Previously it was not possible to disable libdw usage if it was
detected. Fix that by adding a meson feature option.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 meson_options.txt              | 5 +++++
 src/libcamera/base/meson.build | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Feb. 6, 2026, 12:36 a.m. UTC | #1
On Fri, Jan 30, 2026 at 10:08:19AM +0100, Barnabás Pőcze wrote:
> Previously it was not possible to disable libdw usage if it was
> detected. Fix that by adding a meson feature option.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  meson_options.txt              | 5 +++++
>  src/libcamera/base/meson.build | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index d600cd1be..8121cf5d2 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -42,6 +42,11 @@ option('lc-compliance',
>          value : 'auto',
>          description : 'Compile the lc-compliance test application')
>  
> +option('libdw',
> +        type : 'feature',
> +        value : 'auto',
> +        description : 'Enable libdw integration for backtrace symbolization')
> +
>  option('libunwind',
>          type : 'feature',
>          value : 'auto',
> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
> index bcf37f71c..b57774f49 100644
> --- a/src/libcamera/base/meson.build
> +++ b/src/libcamera/base/meson.build
> @@ -26,7 +26,7 @@ libcamera_base_internal_sources = files([
>      'utils.cpp',
>  ])
>  
> -libdw = dependency('libdw', required : false)
> +libdw = dependency('libdw', required : get_option('libdw'))
>  libunwind = dependency('libunwind', required : get_option('libunwind'))
>  
>  if cc.has_header_symbol('execinfo.h', 'backtrace')
Kieran Bingham Feb. 6, 2026, 1:05 a.m. UTC | #2
Quoting Laurent Pinchart (2026-02-06 00:36:03)
> On Fri, Jan 30, 2026 at 10:08:19AM +0100, Barnabás Pőcze wrote:
> > Previously it was not possible to disable libdw usage if it was
> > detected. Fix that by adding a meson feature option.
> > 
> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  meson_options.txt              | 5 +++++
> >  src/libcamera/base/meson.build | 2 +-
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meson_options.txt b/meson_options.txt
> > index d600cd1be..8121cf5d2 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -42,6 +42,11 @@ option('lc-compliance',
> >          value : 'auto',
> >          description : 'Compile the lc-compliance test application')
> >  
> > +option('libdw',
> > +        type : 'feature',
> > +        value : 'auto',
> > +        description : 'Enable libdw integration for backtrace symbolization')
> > +
> >  option('libunwind',
> >          type : 'feature',
> >          value : 'auto',
> > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
> > index bcf37f71c..b57774f49 100644
> > --- a/src/libcamera/base/meson.build
> > +++ b/src/libcamera/base/meson.build
> > @@ -26,7 +26,7 @@ libcamera_base_internal_sources = files([
> >      'utils.cpp',
> >  ])
> >  
> > -libdw = dependency('libdw', required : false)
> > +libdw = dependency('libdw', required : get_option('libdw'))

That likely pushes me further to thinking the libjpeg variants should be
simply that as an option...

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> >  libunwind = dependency('libunwind', required : get_option('libunwind'))
> >  
> >  if cc.has_header_symbol('execinfo.h', 'backtrace')
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/meson_options.txt b/meson_options.txt
index d600cd1be..8121cf5d2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -42,6 +42,11 @@  option('lc-compliance',
         value : 'auto',
         description : 'Compile the lc-compliance test application')
 
+option('libdw',
+        type : 'feature',
+        value : 'auto',
+        description : 'Enable libdw integration for backtrace symbolization')
+
 option('libunwind',
         type : 'feature',
         value : 'auto',
diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
index bcf37f71c..b57774f49 100644
--- a/src/libcamera/base/meson.build
+++ b/src/libcamera/base/meson.build
@@ -26,7 +26,7 @@  libcamera_base_internal_sources = files([
     'utils.cpp',
 ])
 
-libdw = dependency('libdw', required : false)
+libdw = dependency('libdw', required : get_option('libdw'))
 libunwind = dependency('libunwind', required : get_option('libunwind'))
 
 if cc.has_header_symbol('execinfo.h', 'backtrace')