From patchwork Thu Sep 28 11:04:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 132134 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CB06B42660; Thu, 28 Sep 2023 13:05:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9633740273; Thu, 28 Sep 2023 13:05:01 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 73B734021D for ; Thu, 28 Sep 2023 13:05:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695899100; x=1727435100; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y2sHiM6SI86zzHZjtz+qgRDiSbI5JuaH4wvzvIjgR58=; b=cuD+aPeM2fdiejMnD+A06Vw6BnbCRN1Eg7QXWsQNWG+azc1dLW2pZdI5 rcdDOjZ+cLapA/qt+8IAPuTc0QX4DZCLOtowdjT4891EH0AIAPWDX77zH lZPOchjgVpjKbvNxk5LQsJmZ+KX6sJ7pa28aIqA93tT3yPoFwM7l9bzTu BTBHiV5rAzYIyUGLEw/6GRGXWISi6Rt8CEV3I8Q78NIdMs+1cW9ngYpot /uzyYhIYGaBTC+zC3poTTnS+3SXtGhtzHQZAndiP+V2oKUloCiSPhrJJy nJc8wYCKyOIiriNPuRrcq0Rf3mtZtJ2kTrRvwln4j1RRVxsySWgfXq31k w==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="412944824" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="412944824" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 04:04:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="743038573" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="743038573" Received: from silpixa00401385.ir.intel.com ([10.237.214.155]) by orsmga007.jf.intel.com with ESMTP; 28 Sep 2023 04:04:58 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: gakhil@marvell.com, Bruce Richardson Subject: [PATCH 1/2] app/test: add support for optional dependencies Date: Thu, 28 Sep 2023 12:04:49 +0100 Message-Id: <20230928110450.862698-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230928092639.162449-1-bruce.richardson@intel.com> References: <20230928092639.162449-1-bruce.richardson@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Some tests make optionally use a component but don't require it for building. If we include the dependency in the per-file lists, then tests may be unnecessarily omitted, as the dependency is not required. On the other hand, removing the optional dependency from the list can cause build failures, as the test case may include the optional code, but then fail to build as the build system won't have added the necessary paths for header inclusion, or the necessary libraries for linking. Resolve this by explicitly providing a list of optional dependencies. Any items in this list will be added to the dependency list if available, but otherwise won't be involved in enable/disable of specific tests. Signed-off-by: Bruce Richardson Reviewed-by: David Marchand Tested-by: Akhil Goyal --- app/test/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/test/meson.build b/app/test/meson.build index 05bae9216d..80b60f68b2 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -5,6 +5,10 @@ deps += ['cmdline', 'ring', 'mempool', 'mbuf'] sources += files('commands.c', 'test.c') +# optional dependencies: some files may use these - and so we should link them in - +# but do not explicitly require them so they are not listed in the per-file lists below +optional_deps = [] + # some other utility C files, providing functions used by various tests # so we need to include these deps in the dependency list for the files using those fns. packet_burst_generator_deps = ['net'] @@ -226,6 +230,12 @@ foreach f, f_deps : source_file_deps sources += files(f) endif endforeach +# add the optional dependencies +foreach d:optional_deps + if is_variable(def_lib + '_rte_' + d) and d not in deps + deps += d + endif +endforeach if cc.has_argument('-Wno-format-truncation') cflags += '-Wno-format-truncation'