From patchwork Sun Aug 14 19:11:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17122 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 777C7C3272 for ; Sun, 14 Aug 2022 19:11:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E035961FBC; Sun, 14 Aug 2022 21:11:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660504284; bh=79IP6eht76jx9wqNdUOEGfqzISsv8jyGYhbNMepDxSs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IH9EvGNYtYB86Fx9kvsE6YXihyN3nLOkUEr/CvQulf/b+ResRBC8o3L7MX//MYrMK xwuzUmTmsuu1mAWIM7v5J4ipPLl9zqqHwksZaH9Tn40rbePD00QxXHbyyNnIQiW/5v rc3ju5aA9R4KzM/CM4WyOOz7V3i4ChEDdCxy2/7PJN4aP9gHKszHxu+clFNEgvIe5b WXGFLkzHqJRLJoUpJofjEDLquzC95IioWELeoUB78sOHyNtNC9t7KjKeM1w655dGj8 pAm6Kmhxc3q0P+GFjj3lPmDj2XkhtVe5/zT9v4PU5MbsA5l4xVAN+ARef79o6Wvwog qCVcCVmeUhs7Q== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1921761FBA for ; Sun, 14 Aug 2022 21:11:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="m4fAJh2s"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8389730A; Sun, 14 Aug 2022 21:11:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1660504282; bh=79IP6eht76jx9wqNdUOEGfqzISsv8jyGYhbNMepDxSs=; h=From:To:Cc:Subject:Date:From; b=m4fAJh2sHmtr27iusF+FyIAY0emynAh05fihlrBhmaZJN5MfhSrMS22Zz3YBqpGQ5 /bn1Pcal1AApXjzF9KXkaAnBhDM3Gs0Y5+YaxLbts7dAhPC1FAEtGxoCSKYD9OlGka cptmguQTN/vb3YbwaFpB3vJXJfD+zxNRycL846vE= 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 Subject: [libcamera-devel] [PATCH] meson: Use dependency() instead of find_library() where possible 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" Usage of find_library() to find dependencies that libcamera needs to compile against can lead to the library being found even if the corresponding headers are not installed. This will then result in a compilation failure. Switch to dependency() for libdw, libunwind and lttng-ust to fix this, all three libraries come with a pkgconfig file that is usually installed by the distribution package that contains the library headers. Reported-by: Christian Rauch Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- meson.build | 2 +- src/libcamera/base/meson.build | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) base-commit: dfc6d711c9f7f0a9868afa5158aa2089163bded3 diff --git a/meson.build b/meson.build index e8b81ad87a6e..72919102ad55 100644 --- a/meson.build +++ b/meson.build @@ -122,7 +122,7 @@ libcamera_includes = include_directories('include') py_modules = [] # Libraries used by multiple components -liblttng = cc.find_library('lttng-ust', required : get_option('tracing')) +liblttng = dependency('lttng-ust', required : get_option('tracing')) # Pipeline handlers # diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build index 7030ad1f5927..3b9d74efe935 100644 --- a/src/libcamera/base/meson.build +++ b/src/libcamera/base/meson.build @@ -22,8 +22,8 @@ libcamera_base_sources = files([ 'utils.cpp', ]) -libdw = cc.find_library('libdw', required : false) -libunwind = cc.find_library('libunwind', required : false) +libdw = dependency('libdw', required : false) +libunwind = dependency('libunwind', required : false) if cc.has_header_symbol('execinfo.h', 'backtrace') config_h.set('HAVE_BACKTRACE', 1)