From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6292B29D2 for ; Fri, 20 Jul 2018 15:28:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 06:28:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,379,1526367600"; d="scan'208";a="66188774" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by FMSMGA003.fm.intel.com with ESMTP; 20 Jul 2018 06:28:30 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 20 Jul 2018 14:28:25 +0100 Message-Id: <20180720132825.772-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] build: improve error message for missing dependency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 13:28:33 -0000 When building a driver or library and a required internal dependency is missing, the error message printed was: Tried to get unknown variable "shared_rte_". However, a better way to handle this is to catch the missing variable earlier and convert it into a proper message, informing the user that the required dependency is missing, and most importantly, what library or driver wanted that dependency. Signed-off-by: Bruce Richardson --- drivers/meson.build | 4 ++++ lib/meson.build | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index 82cc8ed49..f94e2fe67 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -62,6 +62,10 @@ foreach class:driver_classes shared_objs = [] static_objs = [] foreach d:deps + if not is_variable('shared_rte_' + d) + error('Missing dependency ' + d + + ' for driver ' + lib_name) + endif shared_objs += [get_variable('shared_rte_' + d)] static_objs += [get_variable('static_rte_' + d)] endforeach diff --git a/lib/meson.build b/lib/meson.build index 4384813f8..71f35d162 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -69,6 +69,10 @@ foreach l:libraries shared_deps = ext_deps static_deps = ext_deps foreach d:deps + if not is_variable('shared_rte_' + d) + error('Missing dependency ' + d + + ' for library ' + lib_name) + endif shared_deps += [get_variable('shared_rte_' + d)] static_deps += [get_variable('static_rte_' + d)] endforeach -- 2.17.0