From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73E22A0350; Fri, 4 Feb 2022 18:43:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46EEA410E8; Fri, 4 Feb 2022 18:42:58 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id F128840041 for ; Fri, 4 Feb 2022 18:42:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643996577; x=1675532577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qOcgvMD67t0FQBAuad4/OKjnMTgYNAuM5LsiMr1NU0Y=; b=K+sRZ5N5pdpprUYix2sNcNbjRo83PpsCjTtBGb6zKmiU0wHHUQCH9QZ1 t851narZiyk8GRxUtKJieaESCk6h9QE3Nc9EotfI+NxXnEWftyASzIAnZ Xewi+mEIgA3Vj3kMC+QX80M6CcMnaqQc5hyOSs+KcLvuZ95ip2P1t06dT v4A5uJ0zVt7H6BXxYdTUf8xbTLPtiyqwjD4dOHUE7X35ZUM34z+Fhrtad PJHaa25ZoYEWybcgKyqx8RrcFDHjdTMin04Tsg6TCFGC2I2Hvg0VkfGdt 3gnJyzOOakMIbAIaTGbzzb2lfzrVceBUgKnSIOdRPW46L2ajDWdc3MwKB Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="229060663" X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="229060663" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 09:42:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="620890488" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 04 Feb 2022 09:42:55 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Fri, 4 Feb 2022 17:42:09 +0000 Message-Id: <20220204174209.440207-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220204174209.440207-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Add support for checking each of our headers for issues when included in a C++ file. Signed-off-by: Bruce Richardson --- buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 buildtools/chkincs/main.cpp diff --git a/buildtools/chkincs/main.cpp b/buildtools/chkincs/main.cpp new file mode 100644 index 0000000000..d25bb8852a --- /dev/null +++ b/buildtools/chkincs/main.cpp @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ +int main(void) { return 0; } diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build index 5ffca89761..beabcd55d8 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -28,3 +28,23 @@ executable('chkincs', sources, dependencies: deps, link_whole: dpdk_static_libraries + dpdk_drivers, install: false) + +# run tests for c++ builds also +if not add_languages('cpp', required: false) + subdir_done() +endif + +gen_cpp_files = generator(gen_c_file_for_header, + output: '@BASENAME@.cpp', + arguments: ['@INPUT@', '@OUTPUT@']) + +cpp_sources = files('main.cpp') +cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers) + +executable('chkincs-cpp', cpp_sources, + cpp_args: ['-include', 'rte_config.h', cflags], + link_args: dpdk_extra_ldflags, + include_directories: includes, + dependencies: deps, + link_whole: dpdk_static_libraries + dpdk_drivers, + install: false) -- 2.32.0