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 DD1B2A00C2; Thu, 10 Feb 2022 13:04:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE9E3426EC; Thu, 10 Feb 2022 13:04:12 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3F6694013F for ; Thu, 10 Feb 2022 13:04:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494651; x=1676030651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qOcgvMD67t0FQBAuad4/OKjnMTgYNAuM5LsiMr1NU0Y=; b=FxKwBfe8otIQgipfSJTubSH3q4iAHJEwU4MHOBpNARAB0oI8N9tMvGGd VnXQ+cTHqdO/K91QjEmgQ4zLSToZCx8EIF34UGjP4mTNCTaLTaCdo7V6T BK98og+7+Vg20qh2bLLUtZOUaQ1AhB3543AtaqMYaHkxYSdc36wtPa8iq 7FMsL/eBiE05wzLWBQwAe1YLoUZRUCiZQ7PCnogiQ5MG56kZ1WqvioPFq Zvp9yP6YZjL9hmzsq4k2+cWqBfP9oFcpXt0CLIwRcxBHBudP24nPsDtKl 1cRc4nF4UOFeKGbjDls9WkJOoVtfZtyxO1MFIxBg7ekgekuqmvQ3W2zKK Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="229443176" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="229443176" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:04:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658367" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:04:09 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 12:02:57 +0000 Message-Id: <20220210120257.585822-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210120257.585822-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210120257.585822-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