From patchwork Thu Dec 7 21:43:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19301 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D7427BD78E for ; Thu, 7 Dec 2023 21:43:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 347E262B32; Thu, 7 Dec 2023 22:43:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1701985413; bh=hh5JG2mCGT4JhFbToYqD1QWuPYtH4fvhlvRmNJ6txjc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xJbsTkYXBTBJ2Cpk8MEmehC5/5e7SDTToUumzlXMgNrAa0pwgp0Q3IMhqmBEMrWzp Up1xSZsf2uXivlY1lvqbQeeTvXrvy1Uen9tUyx7rTmjr8TZngH6SEYF9WvgU2pb81q uNe0g/FS6iHjLbtSCynaC0TD46MphVkPEEMbAehfhp1KqwdTb3c8+SfnULXg91dwgb X74Tuiw8T5fXdAdfcxdEOBCBgIrzRGWpAcT1+tsQefLcfSRdArDpcgkK04uQnvpkVb GSvUDC4tfsiImxocIgk62seULiUJ4lggyvnczu9sHFGjD5dQutmOERg6jiL8Q3cq25 1AsXjxbrH2ZsQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D002629E1 for ; Thu, 7 Dec 2023 22:43:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fdNTaeXY"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5CCD4BB2 for ; Thu, 7 Dec 2023 22:42:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1701985370; bh=hh5JG2mCGT4JhFbToYqD1QWuPYtH4fvhlvRmNJ6txjc=; h=From:To:Subject:Date:From; b=fdNTaeXYQMfPcbb6uD3iEvYlleoK8p9HWQ117pWHD0UemCVbKPWIEqDujmW0IZFkm VPVbCd2BK8A8qUSM2vfefJaobXlrLPH7dj0Tf1d3bJUEAR0gX1ErIFbFTah+1SmhoQ OFIaE+GIYM0Agnptraht9ByL8w8pt6GLkjvz7hyw= To: libcamera-devel@lists.libcamera.org Date: Thu, 7 Dec 2023 23:43:37 +0200 Message-ID: <20231207214337.16199-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] meson: Replace hack with usage of '@BASENAME@' X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Starting with meson 0.59, the custom_target() function substitutes '@BASENAME@' in the output parameter with the input file name, with the extension removed. This is exactly what we implement manually when generating the IPA interface .cpp files. Furthermore, starting with meson 0.60, the 'name' positional parameter to the custom_target() function is optional, and defaults to the basename of the output file (including the extension). This is exactly the name we compute manually and pass to the function. As libcamera requires meson 0.60 or newer, we can depend on those two features and drop manual computation of the base name. This fixes a warning with recent meson versions that complain that passing a file object to the format() function is a broken feature: WARNING: Broken features used: * 1.3.0: {'str.format: Value other than strings, integers, bools, options, dictionaries and lists thereof.'} Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/ipa/meson.build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) base-commit: 1c56d2a2cd2dcca86272675e21bbb1770d32db1f diff --git a/src/libcamera/ipa/meson.build b/src/libcamera/ipa/meson.build index 4469524060de..ef73b3f98816 100644 --- a/src/libcamera/ipa/meson.build +++ b/src/libcamera/ipa/meson.build @@ -3,13 +3,10 @@ libcamera_ipa_interfaces = [] foreach file : ipa_mojom_files - name = '@0@'.format(file).split('/')[-1].split('.')[0] - # {pipeline}_ipa_interface.cpp libcamera_ipa_interfaces += \ - custom_target(name + '_ipa_interface_cpp', - input : file, - output : name + '_ipa_interface.cpp', + custom_target(input : file, + output : '@BASENAME@_ipa_interface.cpp', command : [ mojom_docs_extractor, '-o', '@OUTPUT@', '@INPUT@'