Show a patch.

GET /api/patches/25621/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 25621,
    "url": "https://patchwork.libcamera.org/api/patches/25621/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25621/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260105093119.1176922-1-barnabas.pocze@ideasonboard.com>",
    "date": "2026-01-05T09:31:19",
    "name": "[v2] meson: Do not force libc++ when using clang",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9302c8db2e4ef5c873b6c5caf5cba6201fd7f4ad",
    "submitter": {
        "id": 216,
        "url": "https://patchwork.libcamera.org/api/people/216/?format=api",
        "name": "Barnabás Pőcze",
        "email": "barnabas.pocze@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25621/mbox/",
    "series": [
        {
            "id": 5680,
            "url": "https://patchwork.libcamera.org/api/series/5680/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5680",
            "date": "2026-01-05T09:31:19",
            "name": "[v2] meson: Do not force libc++ when using clang",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5680/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25621/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25621/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0C73EBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 09:31:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3763361F9F;\n\tMon,  5 Jan 2026 10:31:26 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F07961F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 10:31:24 +0100 (CET)",
            "from pb-laptop.local (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8BC05558;\n\tMon,  5 Jan 2026 10:31:03 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hkEOLxoG\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767605463;\n\tbh=4bPBPmhy3KDwP7LkEQa2XopAiYt8lztkpCPdBuErOpA=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=hkEOLxoGu1+sLZFaol7QbsqUkTSkVQroSBi9cT/f7TG31XsHgk+9AQwcR+IYiM4da\n\t+K8z+Wh3JgJ0MT/OYcUGZUFjFJ//VHcu5XGoExznBrcwhqb9GpWJRGKxIvitEESOnT\n\tkU9JFHichfePaNs8md5hPrQgYcoryDgCVSHzhaOY=",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Khem Raj <raj.khem@gmail.com>",
        "Subject": "[PATCH v2] meson: Do not force libc++ when using clang",
        "Date": "Mon,  5 Jan 2026 10:31:19 +0100",
        "Message-ID": "<20260105093119.1176922-1-barnabas.pocze@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Khem Raj <raj.khem@gmail.com>\n\nCurrently the meson scripts force the use of libc++ when using clang\nas the compiler. This behaviour cannot be overridden by the user, and\nit is suboptimal as it means that a clang build cannot reliably use\nsystem qt, gtest, etc since those might use libstdc++.\n\nTo fix that, simply do not force the use of any particular standard\nlibrary, and detect the currently used one based on predefined macros.\nThis is exactly what meson does internally, although the result is\nnot readily available for meson scripts[0][1]; so the test needs\nto be largely replicated.\n\n[0]: https://github.com/mesonbuild/meson/commit/675b47b0692131fae974298829ba807d730ab098\n[1]: https://stackoverflow.com/a/31658120\n\nCloses: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226\nSigned-off-by: Khem Raj <raj.khem@gmail.com>\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\nchanges in v2:\n  * use `has_header_symbol()`\n  * do not set `-stdlib=` when using clang\n  * reword commit message\n\nv1: https://patchwork.libcamera.org/patch/24811/\n---\n meson.build | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\n--\n2.52.0",
    "diff": "diff --git a/meson.build b/meson.build\nindex fa6487f65..4aa7ecc96 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -118,7 +118,16 @@ cpp_arguments = [\n     '-Wnon-virtual-dtor',\n ]\n\n-cxx_stdlib = 'libstdc++'\n+cxx_stdlib = ''\n+\n+# \\todo Switch to `version` when moving to C++20 as `ciso646` has been removed in C++20.\n+if cxx.has_header_symbol('ciso646', '_LIBCPP_VERSION')\n+    cxx_stdlib = 'libc++'\n+elif cxx.has_header_symbol('ciso646', '__GLIBCXX__')\n+    cxx_stdlib = 'libstdc++'\n+endif\n+\n+message('Detected C++ standard library: ' + cxx_stdlib)\n\n if cc.get_id() == 'clang'\n     if cc.version().version_compare('<9')\n@@ -139,15 +148,6 @@ if cc.get_id() == 'clang'\n         endif\n     endif\n\n-    # Use libc++ by default if available instead of libstdc++ when compiling\n-    # with clang.\n-    if cc.find_library('c++', required : false).found()\n-        cpp_arguments += [\n-            '-stdlib=libc++',\n-        ]\n-        cxx_stdlib = 'libc++'\n-    endif\n-\n     cpp_arguments += [\n         '-Wextra-semi',\n         '-Wthread-safety',\n",
    "prefixes": [
        "v2"
    ]
}