{"id":17122,"url":"https://patchwork.libcamera.org/api/patches/17122/?format=json","web_url":"https://patchwork.libcamera.org/patch/17122/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>","date":"2022-08-14T19:11:09","name":"[libcamera-devel] meson: Use dependency() instead of find_library() where possible","commit_ref":"b954deff2071399ca941ffd719e762968f28feae","pull_url":null,"state":"accepted","archived":false,"hash":"474432dc12c2c93eb969eefb74fa57c7279b96a6","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17122/mbox/","series":[{"id":3415,"url":"https://patchwork.libcamera.org/api/series/3415/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3415","date":"2022-08-14T19:11:09","name":"[libcamera-devel] meson: Use dependency() instead of find_library() where possible","version":1,"mbox":"https://patchwork.libcamera.org/series/3415/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17122/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17122/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 777C7C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 14 Aug 2022 19:11:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E035961FBC;\n\tSun, 14 Aug 2022 21:11:24 +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 1921761FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Aug 2022 21:11:23 +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 8389730A;\n\tSun, 14 Aug 2022 21:11:22 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660504284;\n\tbh=79IP6eht76jx9wqNdUOEGfqzISsv8jyGYhbNMepDxSs=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=IH9EvGNYtYB86Fx9kvsE6YXihyN3nLOkUEr/CvQulf/b+ResRBC8o3L7MX//MYrMK\n\txwuzUmTmsuu1mAWIM7v5J4ipPLl9zqqHwksZaH9Tn40rbePD00QxXHbyyNnIQiW/5v\n\trc3ju5aA9R4KzM/CM4WyOOz7V3i4ChEDdCxy2/7PJN4aP9gHKszHxu+clFNEgvIe5b\n\tWXGFLkzHqJRLJoUpJofjEDLquzC95IioWELeoUB78sOHyNtNC9t7KjKeM1w655dGj8\n\tpAm6Kmhxc3q0P+GFjj3lPmDj2XkhtVe5/zT9v4PU5MbsA5l4xVAN+ARef79o6Wvwog\n\tqCVcCVmeUhs7Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660504282;\n\tbh=79IP6eht76jx9wqNdUOEGfqzISsv8jyGYhbNMepDxSs=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=m4fAJh2sHmtr27iusF+FyIAY0emynAh05fihlrBhmaZJN5MfhSrMS22Zz3YBqpGQ5\n\t/bn1Pcal1AApXjzF9KXkaAnBhDM3Gs0Y5+YaxLbts7dAhPC1FAEtGxoCSKYD9OlGka\n\tcptmguQTN/vb3YbwaFpB3vJXJfD+zxNRycL846vE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"m4fAJh2s\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sun, 14 Aug 2022 22:11:09 +0300","Message-Id":"<20220814191109.31090-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] meson: Use dependency() instead of\n\tfind_library() where possible","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Usage of find_library() to find dependencies that libcamera needs to\ncompile against can lead to the library being found even if the\ncorresponding headers are not installed. This will then result in a\ncompilation failure. Switch to dependency() for libdw, libunwind and\nlttng-ust to fix this, all three libraries come with a pkgconfig file\nthat is usually installed by the distribution package that contains the\nlibrary headers.\n\nReported-by: Christian Rauch <Rauch.Christian@gmx.de>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n meson.build                    | 2 +-\n src/libcamera/base/meson.build | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\n\nbase-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3","diff":"diff --git a/meson.build b/meson.build\nindex e8b81ad87a6e..72919102ad55 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -122,7 +122,7 @@ libcamera_includes = include_directories('include')\n py_modules = []\n \n # Libraries used by multiple components\n-liblttng = cc.find_library('lttng-ust', required : get_option('tracing'))\n+liblttng = dependency('lttng-ust', required : get_option('tracing'))\n \n # Pipeline handlers\n #\ndiff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\nindex 7030ad1f5927..3b9d74efe935 100644\n--- a/src/libcamera/base/meson.build\n+++ b/src/libcamera/base/meson.build\n@@ -22,8 +22,8 @@ libcamera_base_sources = files([\n     'utils.cpp',\n ])\n \n-libdw = cc.find_library('libdw', required : false)\n-libunwind = cc.find_library('libunwind', required : false)\n+libdw = dependency('libdw', required : false)\n+libunwind = dependency('libunwind', required : false)\n \n if cc.has_header_symbol('execinfo.h', 'backtrace')\n     config_h.set('HAVE_BACKTRACE', 1)\n","prefixes":["libcamera-devel"]}