[{"id":23775,"web_url":"https://patchwork.libcamera.org/comment/23775/","msgid":"<165713572789.2961003.12757712884086189724@Monstersaurus>","date":"2022-07-06T19:28:47","subject":"Re: [libcamera-devel] [PATCH] meson: correctly pass the global\n\tinclude to the compiler","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Eli,\n\nQuoting Eli Schwartz via libcamera-devel (2022-07-06 20:10:16)\n> It's not safe to assume `-include config.h` works, since this depends on\n> the functionality of the compiler that the cwd when running the compiler\n> is searched first.\n> \n> When libcamera is included as a Meson subproject, the cwd of the\n> compiler is the cwd of the main project, not of libcamera's build dir,\n> and thus cannot be found. Instead, pass the include filename as a path\n> based on the current build dir.\n> \n\nThank you for identifying this so quickly and supporting on the meson\nchannel.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>\n> ---\n>  meson.build | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 6d7d3ca6..3f7a3f56 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -44,7 +44,7 @@ endif\n>  \n>  common_arguments = [\n>      '-Wshadow',\n> -    '-include', 'config.h',\n> +    '-include', meson.current_build_dir() / 'config.h',\n>  ]\n>  \n>  c_arguments = []\n> -- \n> 2.35.1\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 9405EBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Jul 2022 19:28:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA33963310;\n\tWed,  6 Jul 2022 21:28:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 51CA460403\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Jul 2022 21:28:51 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B9B8530A;\n\tWed,  6 Jul 2022 21:28:50 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657135732;\n\tbh=c5F3T8WC3Zhkl/TiHoPM+Oi7tf37siWrV7llwxZ4D+s=;\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=eq9Pk3iChxRRWIWToiWSxPi549eH1vQ49yrSD5phFu8wU837amttz+p1Oum0Z/wxV\n\tcKA+AP75E5vPbx+N3yL6rVM305w2BDCap9s2YBPWCWs6oUa6cjEqJYK8JEpzd+UlvK\n\t3SoluBdvqPw4iOqumHKInGG9zmykOOVl5AvgfuoCFPpCB4N1xm877BIs9IcAxOP3dh\n\t4wDE/ekvVhdWSi5sBfF7+y/BdBEcV9tIBs4WPu5XMmaWDJmwGJiqqprO1C8W3czKSu\n\tlxfTHBVWPDsaGYNwTcfNC9Xp9MuatbgB6oAFzU7A/nLNPXFlnQftjiTmX9tETTQBTo\n\tRSr24IMVN/RFQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1657135730;\n\tbh=c5F3T8WC3Zhkl/TiHoPM+Oi7tf37siWrV7llwxZ4D+s=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=MVXP9sKbuy13lx3QSwXv75Lx/VVmVKPUwOCZjKbhPrjw7aCbHSl5Kp0AClDP85W73\n\tEiegXtQJE3bbuphoL0SgksVPQAZRNA2ZOzqM6ReItBYBtspTp/+4MO2kr3Z5uN96zD\n\theaUauyr3Nmn6ScwLCrvhHKDEmiKEFdAajjWC7RM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"MVXP9sKb\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220706191016.2842476-1-eschwartz93@gmail.com>","References":"<20220706191016.2842476-1-eschwartz93@gmail.com>","To":"Eli Schwartz <eschwartz93@gmail.com>, libcamera-devel@lists.libcamera.org","Date":"Wed, 06 Jul 2022 20:28:47 +0100","Message-ID":"<165713572789.2961003.12757712884086189724@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: correctly pass the global\n\tinclude to the compiler","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>"}},{"id":23777,"web_url":"https://patchwork.libcamera.org/comment/23777/","msgid":"<YsX+6F86l2ObsH3o@pendragon.ideasonboard.com>","date":"2022-07-06T21:30:16","subject":"Re: [libcamera-devel] [PATCH] meson: correctly pass the global\n\tinclude to the compiler","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Eli,\n\nThank you for the patch.\n\nOn Wed, Jul 06, 2022 at 03:10:16PM -0400, Eli Schwartz via libcamera-devel wrote:\n> It's not safe to assume `-include config.h` works, since this depends on\n> the functionality of the compiler that the cwd when running the compiler\n> is searched first.\n> \n> When libcamera is included as a Meson subproject, the cwd of the\n> compiler is the cwd of the main project, not of libcamera's build dir,\n> and thus cannot be found. Instead, pass the include filename as a path\n> based on the current build dir.\n> \n> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>\n> ---\n>  meson.build | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/meson.build b/meson.build\n> index 6d7d3ca6..3f7a3f56 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -44,7 +44,7 @@ endif\n>  \n>  common_arguments = [\n>      '-Wshadow',\n> -    '-include', 'config.h',\n> +    '-include', meson.current_build_dir() / 'config.h',\n\nI may be a bit better (being pedantic) to use the return value of the\nconfigure_file() function here, but that would require reorganizing the\ntop-level meson.build and is probably not worth it.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  ]\n>  \n>  c_arguments = []","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 5284DBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Jul 2022 21:30:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A2F5163310;\n\tWed,  6 Jul 2022 23:30:43 +0200 (CEST)","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 2D87B60403\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Jul 2022 23:30:42 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E9B1593;\n\tWed,  6 Jul 2022 23:30:41 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657143043;\n\tbh=Xibn4HXnT6pUCzIC7cKDGt2cgZyiIznbFS99bFnyvvM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=R3aGPBdrzkg13OvnTCbFWdQ8o8fdnKaLRMgOg38nr+R7tXa15eDEai8iLzgXJ55yv\n\t1ULn9A5KIrbIP55bvYY6qJ7kJ4lx3q/NjhNJlhBuCkY3HNwgZDMGVTzZ9dhQWVMnbk\n\tV0mbQtDPknvL76sX8KIYh7smzyhAjR7bM+3c/RjEsiNoDx6fcJ7arL8Kt/7W8JkVaR\n\tZdj6PkM53MKw5P/Mh2CwcnJu8cOL2hyk5FAY27Osz/dQNG0ZNHVD79/jE6IZvTXNej\n\t+gBzpSsSzpXzgFYo5frANDIgtgVg2cEvhbQSToTF9TQD34y5rUU1tFA9Clh7gwE10N\n\twc3Iqa9Pqc5xg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1657143041;\n\tbh=Xibn4HXnT6pUCzIC7cKDGt2cgZyiIznbFS99bFnyvvM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ENSTChvusHSYKOOKeYoEgxnGZi0kTJ++AaPawmnhScrziaK8HGSSYpiZhO/iJa9gx\n\tUs9/JQ2BmJezQ6wTufamKEpADEB7aeD1WJ+DLO+nQyyEGwoR7Tk9YBBx2+Ml5jaRm6\n\t/Zgm4ydLlyoXf32qfsEAIvcy+thLxpQbuK2Es+4Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ENSTChvu\"; dkim-atps=neutral","Date":"Thu, 7 Jul 2022 00:30:16 +0300","To":"Eli Schwartz <eschwartz93@gmail.com>","Message-ID":"<YsX+6F86l2ObsH3o@pendragon.ideasonboard.com>","References":"<20220706191016.2842476-1-eschwartz93@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220706191016.2842476-1-eschwartz93@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH] meson: correctly pass the global\n\tinclude to the compiler","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]