buildtools/chkincs: test headers for C++ compatibility
Add support for checking each of our headers for issues when included in a C++ file. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
parent
b93ad98c35
commit
5e437164df
@ -74,6 +74,7 @@ fi
|
|||||||
|
|
||||||
if [ "$BUILD_32BIT" = "true" ]; then
|
if [ "$BUILD_32BIT" = "true" ]; then
|
||||||
OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
|
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"
|
export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -116,7 +116,7 @@ jobs:
|
|||||||
libdw-dev
|
libdw-dev
|
||||||
- name: Install i386 cross compiling packages
|
- name: Install i386 cross compiling packages
|
||||||
if: env.BUILD_32BIT == 'true'
|
if: env.BUILD_32BIT == 'true'
|
||||||
run: sudo apt install -y gcc-multilib
|
run: sudo apt install -y gcc-multilib g++-multilib
|
||||||
- name: Install aarch64 cross compiling packages
|
- name: Install aarch64 cross compiling packages
|
||||||
if: env.AARCH64 == 'true'
|
if: env.AARCH64 == 'true'
|
||||||
run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||||
|
4
buildtools/chkincs/main.cpp
Normal file
4
buildtools/chkincs/main.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
* Copyright(c) 2021 Intel Corporation
|
||||||
|
*/
|
||||||
|
int main(void) { return 0; }
|
@ -27,3 +27,21 @@ executable('chkincs', sources,
|
|||||||
include_directories: includes,
|
include_directories: includes,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
install: false)
|
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],
|
||||||
|
include_directories: includes,
|
||||||
|
dependencies: deps,
|
||||||
|
install: false)
|
||||||
|
@ -246,7 +246,8 @@ if check_cc_flags '-m32' ; then
|
|||||||
export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig'
|
export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig'
|
||||||
fi
|
fi
|
||||||
target_override='i386-pc-linux-gnu'
|
target_override='i386-pc-linux-gnu'
|
||||||
build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32'
|
build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \
|
||||||
|
-Dcpp_args='-m32' -Dcpp_link_args='-m32'
|
||||||
target_override=
|
target_override=
|
||||||
unset PKG_CONFIG_LIBDIR
|
unset PKG_CONFIG_LIBDIR
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user