[{"id":26018,"web_url":"https://patchwork.libcamera.org/comment/26018/","msgid":"<167041471897.9133.305359503047294026@Monstersaurus>","date":"2022-12-07T12:05:18","subject":"Re: [libcamera-devel] [PATCH v2] meson: Use library() in order to\n\tlet user chose the library type","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Christian,\n\nQuoting Christian Rauch via libcamera-devel (2022-12-02 21:08:18)\n> Defining libraries via shared_library() prevents compiling libcamera as\n> static library. The meson project recommends using library() instead of\n> shared_library(), static_library() or both_libraries():\n> https://mesonbuild.com/Reference-manual_functions.html#library\n\nI'm afraid I'm a bit worried by this patch. It's not clear what you're\ntrying to solve?\n\nlibcamera doesn't really fit well to static library usage in my opinion.\n(At least not right now).\n\nBecause libcamera dynamically loads IPA modules, which are identified by\na configured path - the implementation of the both the library and the\nIPA's should 'match'. We do have an ability to version match IPA\ncomponents, but I don't think it's used right now. Perhaps we should tie\nthat to the version number of libcamera at least. (It was supposed to be\nan IPA interface specific version number).\n\nIf you statically link in libcamera to an application, you won't be able\nto statically link in the IPA modules, and I would be worried that this\nwould cause support issues in the future.\n\nIf you are trying to ensure your application does not use a distribution\nprovided package of libcamera, I would recommend instead building a\ncustom libcamera with a custom -Dprefix=/usr/local/mylibcamera/ and\nusing that to link against with your application. Then all the search\npaths will be correct, and it would function without the distribution\ninstalled package.\n\n--\nKieran\n\n\n\n\n> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n> ---\n>  src/libcamera/base/meson.build | 18 +++++++++---------\n>  src/libcamera/meson.build      | 18 +++++++++---------\n>  2 files changed, 18 insertions(+), 18 deletions(-)\n> \n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index 7a7fd7e4..91dc1e71 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -48,15 +48,15 @@ libcamera_base_deps = [\n>  # the use of headers which must not be exposed to the libcamera public api.\n>  libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> \n> -libcamera_base_lib = shared_library('libcamera-base',\n> -                                    [libcamera_base_sources, libcamera_base_headers],\n> -                                    version : libcamera_version,\n> -                                    soversion : libcamera_soversion,\n> -                                    name_prefix : '',\n> -                                    install : true,\n> -                                    cpp_args : libcamera_base_args,\n> -                                    include_directories : libcamera_includes,\n> -                                    dependencies : libcamera_base_deps)\n> +libcamera_base_lib = library('libcamera-base',\n> +                             [libcamera_base_sources, libcamera_base_headers],\n> +                             version : libcamera_version,\n> +                             soversion : libcamera_soversion,\n> +                             name_prefix : '',\n> +                             install : true,\n> +                             cpp_args : libcamera_base_args,\n> +                             include_directories : libcamera_includes,\n> +                             dependencies : libcamera_base_deps)\n> \n>  libcamera_base = declare_dependency(sources : [\n>                                          libcamera_base_headers,\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 0494e808..cd1bf4ed 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -163,15 +163,15 @@ libcamera_deps = [\n>  # runtime if the library is running from an installed location by checking\n>  # for the presence or abscence of the dynamic tag.\n> \n> -libcamera = shared_library('libcamera',\n> -                           libcamera_sources,\n> -                           version : libcamera_version,\n> -                           soversion : libcamera_soversion,\n> -                           name_prefix : '',\n> -                           install : true,\n> -                           include_directories : includes,\n> -                           build_rpath : '/',\n> -                           dependencies : libcamera_deps)\n> +libcamera = library('libcamera',\n> +                    libcamera_sources,\n> +                    version : libcamera_version,\n> +                    soversion : libcamera_soversion,\n> +                    name_prefix : '',\n> +                    install : true,\n> +                    include_directories : includes,\n> +                    build_rpath : '/',\n> +                    dependencies : libcamera_deps)\n> \n>  libcamera_public = declare_dependency(sources : [\n>                                            libcamera_ipa_headers,\n> --\n> 2.34.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 23312BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Dec 2022 12:05:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9F0F563336;\n\tWed,  7 Dec 2022 13:05:23 +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 8B62563335\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Dec 2022 13:05:21 +0100 (CET)","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 04D9287B;\n\tWed,  7 Dec 2022 13:05:20 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670414723;\n\tbh=HfqG6Bf8tVOv30CLdH7eWGoLZ575/T53xDmlAw0vMaE=;\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=tTjJsmNK1gZIgQZzrFVAax1RjqbPcykkytj+agehPQomcXcR2xlcIEBpakHAwj+vE\n\tiz/wUAMLMwfcLXaLfTN4Ms1ZERhX+G5f8xkBL7LYGTiFX8RwBK2DpQJs+NsspB6d5n\n\tEWk+kOl5o7/gZ7n49NmCZvs3rDCVw7xhq2GmYCuNc7UOuby+L6v6XdiwaboKxfOYdV\n\txbDm44fHw+R5U/Ac2zT/o+U51HW+XefgnvppwrJN3b63YqaIEHLlQICpdX/3FKBwwB\n\t9QXcJdPhTkJ7wLJ0jPVLRWTFxLW6CkC8hxGr3GaDai838E37qV8FDbr8Rnjdz9+/Dr\n\tzQ80Ww1xBTY8Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1670414721;\n\tbh=HfqG6Bf8tVOv30CLdH7eWGoLZ575/T53xDmlAw0vMaE=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=X54MOONRgIELuSRlY2EjsECPBevVpY2PDF0NAUF5jVyCelJ8HNozgoi4ZUfXsFfql\n\tENqb9kMTR0Z3zftdWMO9grmjJgwlSsVETup5feulXsd+M6h4nQcxnTKfdFZylBnvZ2\n\tV1k5LWrQGbRnnT8e34dfJAHQzZyzUOttOwVI2mMs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"X54MOONR\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20221202210818.343046-1-Rauch.Christian@gmx.de>","References":"<20221202210818.343046-1-Rauch.Christian@gmx.de>","To":"Christian Rauch <Rauch.Christian@gmx.de>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 07 Dec 2022 12:05:18 +0000","Message-ID":"<167041471897.9133.305359503047294026@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] meson: Use library() in order to\n\tlet user chose the library type","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>"}}]