[v1] apps: qcam: Fix clang build
diff mbox series

Message ID 20260223091622.322064-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1] apps: qcam: Fix clang build
Related show

Commit Message

Barnabás Pőcze Feb. 23, 2026, 9:16 a.m. UTC
While gcc ignores attempts to disable unknown warnings, clang does not
(`-Wunknown-warning-option`), thus compilation fails due to the recent
addition of `-Wno-sfinae-incomplete`. So only add it conditionally.

Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
Fixes: aa2a0812e6692a ("apps: qcam: Disable -Wsfinae-incomplete")
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
I would still love to merge https://patchwork.libcamera.org/patch/26160/
in some form to avoid this in the future.
---
 src/apps/qcam/meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--
2.53.0

Comments

Kieran Bingham Feb. 23, 2026, 9:25 a.m. UTC | #1
Quoting Barnabás Pőcze (2026-02-23 09:16:22)
> While gcc ignores attempts to disable unknown warnings, clang does not
> (`-Wunknown-warning-option`), thus compilation fails due to the recent
> addition of `-Wno-sfinae-incomplete`. So only add it conditionally.
> 
> Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
> Fixes: aa2a0812e6692a ("apps: qcam: Disable -Wsfinae-incomplete")
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
> I would still love to merge https://patchwork.libcamera.org/patch/26160/
> in some form to avoid this in the future.
> ---
>  src/apps/qcam/meson.build | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/apps/qcam/meson.build b/src/apps/qcam/meson.build
> index 8eb815eed..ef4209389 100644
> --- a/src/apps/qcam/meson.build
> +++ b/src/apps/qcam/meson.build
> @@ -40,7 +40,6 @@ qt6_cpp_args = [
>      apps_cpp_args,
>      '-DQT_NO_KEYWORDS',
>      '-Wno-extra-semi',
> -    '-Wno-sfinae-incomplete',
>  ]
> 
>  # gcc 12 and 13 output a false positive variable shadowing warning with Qt
> @@ -50,6 +49,10 @@ if qt6_dep.version().version_compare('>=6.9.0') and \
>      qt6_cpp_args += ['-Wno-shadow']
>  endif
> 
> +if cxx.get_id() == 'gcc' and cxx.version().version_compare('>=16')
> +    qt6_cpp_args += ['-Wno-sfinae-incomplete']
> +endif


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

> +
>  resources = qt6.preprocess(moc_headers : qcam_moc_headers,
>                             qresources : qcam_resources,
>                             dependencies : qt6_dep)
> --
> 2.53.0
Laurent Pinchart Feb. 23, 2026, 9:46 a.m. UTC | #2
On Mon, Feb 23, 2026 at 10:16:22AM +0100, Barnabás Pőcze wrote:
> While gcc ignores attempts to disable unknown warnings, clang does not
> (`-Wunknown-warning-option`), thus compilation fails due to the recent
> addition of `-Wno-sfinae-incomplete`. So only add it conditionally.
> 
> Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
> Fixes: aa2a0812e6692a ("apps: qcam: Disable -Wsfinae-incomplete")
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

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

> ---
> I would still love to merge https://patchwork.libcamera.org/patch/26160/
> in some form to avoid this in the future.
> ---
>  src/apps/qcam/meson.build | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/apps/qcam/meson.build b/src/apps/qcam/meson.build
> index 8eb815eed..ef4209389 100644
> --- a/src/apps/qcam/meson.build
> +++ b/src/apps/qcam/meson.build
> @@ -40,7 +40,6 @@ qt6_cpp_args = [
>      apps_cpp_args,
>      '-DQT_NO_KEYWORDS',
>      '-Wno-extra-semi',
> -    '-Wno-sfinae-incomplete',
>  ]
> 
>  # gcc 12 and 13 output a false positive variable shadowing warning with Qt
> @@ -50,6 +49,10 @@ if qt6_dep.version().version_compare('>=6.9.0') and \
>      qt6_cpp_args += ['-Wno-shadow']
>  endif
> 
> +if cxx.get_id() == 'gcc' and cxx.version().version_compare('>=16')
> +    qt6_cpp_args += ['-Wno-sfinae-incomplete']
> +endif
> +
>  resources = qt6.preprocess(moc_headers : qcam_moc_headers,
>                             qresources : qcam_resources,
>                             dependencies : qt6_dep)

Patch
diff mbox series

diff --git a/src/apps/qcam/meson.build b/src/apps/qcam/meson.build
index 8eb815eed..ef4209389 100644
--- a/src/apps/qcam/meson.build
+++ b/src/apps/qcam/meson.build
@@ -40,7 +40,6 @@  qt6_cpp_args = [
     apps_cpp_args,
     '-DQT_NO_KEYWORDS',
     '-Wno-extra-semi',
-    '-Wno-sfinae-incomplete',
 ]

 # gcc 12 and 13 output a false positive variable shadowing warning with Qt
@@ -50,6 +49,10 @@  if qt6_dep.version().version_compare('>=6.9.0') and \
     qt6_cpp_args += ['-Wno-shadow']
 endif

+if cxx.get_id() == 'gcc' and cxx.version().version_compare('>=16')
+    qt6_cpp_args += ['-Wno-sfinae-incomplete']
+endif
+
 resources = qt6.preprocess(moc_headers : qcam_moc_headers,
                            qresources : qcam_resources,
                            dependencies : qt6_dep)