[libcamera-ci,v1] Force libc++ with meson native files
diff mbox series

Message ID 20260105093130.1177121-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [libcamera-ci,v1] Force libc++ with meson native files
Related show

Commit Message

Barnabás Pőcze Jan. 5, 2026, 9:31 a.m. UTC
Currently libcamera's meson scripts force the usage of libc++ if clang
is detected as the compiler. This is not ideal because it cannot be
overridden by the user. So instead of depending on this behaviour
for libc++ testing, use meson native files to force the use of
libc++ with clang.

Unfortunately on debian 13, due a meson bug, a workaround is needed
to avoid a macro redefinition error[0].

[0]: https://github.com/mesonbuild/meson/issues/13812

Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 .gitlab-ci/meson/clang.native  | 3 +++
 .gitlab-ci/meson/libc++.native | 3 +++
 gitlab-ci.yml                  | 4 ++++
 3 files changed, 10 insertions(+)
 create mode 100644 .gitlab-ci/meson/clang.native
 create mode 100644 .gitlab-ci/meson/libc++.native

--
2.52.0

Patch
diff mbox series

diff --git a/.gitlab-ci/meson/clang.native b/.gitlab-ci/meson/clang.native
new file mode 100644
index 0000000..f00b0f0
--- /dev/null
+++ b/.gitlab-ci/meson/clang.native
@@ -0,0 +1,3 @@ 
+[binaries]
+c = ['clang']
+cpp = ['clang++']
diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native
new file mode 100644
index 0000000..9c99d5a
--- /dev/null
+++ b/.gitlab-ci/meson/libc++.native
@@ -0,0 +1,3 @@ 
+[built-in options]
+cpp_args = ['-stdlib=libc++']
+cpp_link_args = ['-stdlib=libc++']
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index 262d519..2e2c4c9 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -30,6 +30,8 @@  variables:
   # clang fails to link with ASan if --no-undefined is enabled.
   MESON_CLANG_OPTIONS: >-
     -D b_lundef=false
+    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/clang.native
+    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/libc++.native
   PACKAGES: >-
     ca-certificates
     git
@@ -322,6 +324,8 @@  build-full:debian:13:
           ${MESON_ALL_OPTIONS}
           ${MESON_CLANG_OPTIONS}
           -D qcam=disabled
+          -D cpp_debugstl=false
+        # `cpp_debugstl=false` needed due to https://github.com/mesonbuild/meson/issues/13812

 build-full:arch:
   extends: