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 C5D5CA00C2; Thu, 10 Feb 2022 15:05:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E757742745; Thu, 10 Feb 2022 15:04:40 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 1D9E94271E for ; Thu, 10 Feb 2022 15:04:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501876; x=1676037876; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4Ibb21kATi9rzqe3WyPjCC7aDfmyQy2U45C/Ium/Krk=; b=DnGIW28zlWbBAjdcZrov6w5thHRdCeNB6mtHlXapfZlq95EQf2WpIuJF BvUhV2X/K4OcTCY1W7QcpBIiWTyOR+8Gx4MuZaKCe+QDiJ0rHNkKMT/Of 68MHnnWA2KvDl/M46dqXWJPOhbDZIdSZ2CeHY6tlpE4Ii5hgK+FF8niFo +1rJ6wtEHst9Tv7Rma8Ry0VsXfN2cB5bgiPDMgVIR/m1KU5on/d+o+kDq 2BGCkMpyZsDsgTXVmmfvJ51IgTWiK7+BIBk74Vg8oUlez+jmsGjJIREMy y5TRTzvLM9fA42CSfenokIar9K4ScSPIiB4k/E4yOvKM84uOmR6oE7Jws A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781119" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781119" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 06:04:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964294" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:34 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v3 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 14:03:55 +0000 Message-Id: <20220210140355.586399-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210140355.586399-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210140355.586399-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 --- .ci/linux-build.sh | 1 + buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 buildtools/chkincs/main.cpp diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index c10c1a8ab5..67d68535e0 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -74,6 +74,7 @@ fi if [ "$BUILD_32BIT" = "true" ]; then OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32" + OPTS="$OPTS -Dcpp_args=-m32 -Dcpp_link_args=-m32" export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig" fi 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