[{"id":28288,"web_url":"https://patchwork.libcamera.org/comment/28288/","msgid":"<170198719382.983319.5471886045126802967@ping.linuxembedded.co.uk>","date":"2023-12-07T22:13:13","subject":"Re: [libcamera-devel] [PATCH] meson: Replace hack with usage of\n\t'@BASENAME@'","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2023-12-07 21:43:37)\n> Starting with meson 0.59, the custom_target() function substitutes\n> '@BASENAME@' in the output parameter with the input file name, with the\n> extension removed. This is exactly what we implement manually when\n> generating the IPA interface .cpp files.\n\nIt's a good job you were sitting down when you discovered that one ;-)\n\n> Furthermore, starting with meson 0.60, the 'name' positional parameter\n> to the custom_target() function is optional, and defaults to the\n> basename of the output file (including the extension). This is exactly\n> the name we compute manually and pass to the function.\n> \n> As libcamera requires meson 0.60 or newer, we can depend on those two\n> features and drop manual computation of the base name. This fixes a\n> warning with recent meson versions that complain that passing a file\n> object to the format() function is a broken feature:\n> \n> WARNING: Broken features used:\n>  * 1.3.0: {'str.format: Value other than strings, integers, bools, options, dictionaries and lists thereof.'}\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIt's a nice bit of magic.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/ipa/meson.build | 7 ++-----\n>  1 file changed, 2 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/libcamera/ipa/meson.build b/src/libcamera/ipa/meson.build\n> index 4469524060de..ef73b3f98816 100644\n> --- a/src/libcamera/ipa/meson.build\n> +++ b/src/libcamera/ipa/meson.build\n> @@ -3,13 +3,10 @@\n>  libcamera_ipa_interfaces = []\n>  \n>  foreach file : ipa_mojom_files\n> -    name = '@0@'.format(file).split('/')[-1].split('.')[0]\n> -\n>      # {pipeline}_ipa_interface.cpp\n>      libcamera_ipa_interfaces += \\\n> -        custom_target(name + '_ipa_interface_cpp',\n> -                      input : file,\n> -                      output : name + '_ipa_interface.cpp',\n> +        custom_target(input : file,\n> +                      output : '@BASENAME@_ipa_interface.cpp',\n>                        command : [\n>                            mojom_docs_extractor,\n>                            '-o', '@OUTPUT@', '@INPUT@'\n> \n> base-commit: 1c56d2a2cd2dcca86272675e21bbb1770d32db1f\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 4F1ADC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Dec 2023 22:13:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C30EF629E3;\n\tThu,  7 Dec 2023 23:13:17 +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 47E7C629E1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Dec 2023 23:13:16 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 98908674;\n\tThu,  7 Dec 2023 23:12:34 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701987197;\n\tbh=LWkzjQ9jFAIrEWmnr9CsOFQsrPOrsg74FnEIQuU1rDU=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=qw8UEG7aWgaxaBoGw1I1J8Mbdu20swBd2eMwt9G1PmSaG4DDuVZtfauklcb2EM7sz\n\tjw0bBpuGCVHqOk13mQiahpv0cCEGL9GgY5CGftyi4E+iIYEy8wqPMkUvwm6qafxezZ\n\tBDWutYFY6AQqW4MVPFnydeqHPEHkDe6mxcHeok8aM+PzxYHmfzek5Ce/TqDHW3RBaB\n\tJyKtRzu4WzwASxYHMEVT6vbL/Imx/dFSk1Tipbs8Su6ILQcRMbv0UjWHONk2K4pFal\n\tUMa9CJnPU2wie0CZ6DH3PwqsUu47scR7NZRmnJiYJqoc2iBa96bqpam6NMeXYVk8S1\n\tak0uWAEXzSw5w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1701987154;\n\tbh=LWkzjQ9jFAIrEWmnr9CsOFQsrPOrsg74FnEIQuU1rDU=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=M1W5XVskkw2wDPNFri6+267nfRdWcnyWN9nozYZKoajJwWpzsYLUWGDWG88tzMaN1\n\twePrSOyuxiEPVuDt2ms7mk+0U1EusGB6/mz4jTtUJUSXMSReIz7KNMD9XdhArbCb5Q\n\tJeaJIKZqgcBxlWtmJ4/8dBBNoHmKgrFhOPAD7MnM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"M1W5XVsk\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20231207214337.16199-1-laurent.pinchart@ideasonboard.com>","References":"<20231207214337.16199-1-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 07 Dec 2023 22:13:13 +0000","Message-ID":"<170198719382.983319.5471886045126802967@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Replace hack with usage of\n\t'@BASENAME@'","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]