Skip to content

Commit

Permalink
buildtools/chkincs: check headers with stable API only
Browse files Browse the repository at this point in the history
An exported header should be usable w/ and w/o ALLOW_EXPERIMENTAL_API so
that an application that only wants stable API may include it.

Plus, the widely common case is that an application will not use
internal API.

Cover those cases but keep the original test.

Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand committed Oct 15, 2024
1 parent 5c2d13c commit 6325167
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions buildtools/chkincs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ gen_c_files = generator(gen_c_file_for_header,
arguments: ['@INPUT@', '@OUTPUT@'])

cflags = machine_args
cflags += '-DALLOW_EXPERIMENTAL_API'
cflags += '-DALLOW_INTERNAL_API'

sources = files('main.c')
sources += gen_c_files.process(dpdk_chkinc_headers)
Expand All @@ -32,6 +30,18 @@ executable('chkincs', sources,
dependencies: deps,
install: false)

executable('chkincs-exp', sources,
c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
include_directories: includes,
dependencies: deps,
install: false)

executable('chkincs-all', sources,
c_args: [cflags, '-DALLOW_EXPERIMENTAL_API', '-DALLOW_INTERNAL_API'],
include_directories: includes,
dependencies: deps,
install: false)

# run tests for c++ builds also
if not add_languages('cpp', required: false)
subdir_done()
Expand All @@ -49,3 +59,16 @@ executable('chkincs-cpp', cpp_sources,
include_directories: includes,
dependencies: deps,
install: false)

executable('chkincs-cpp-exp', cpp_sources,
cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API'],
include_directories: includes,
dependencies: deps,
install: false)

executable('chkincs-cpp-all', cpp_sources,
cpp_args: ['-include', 'rte_config.h', cflags, '-DALLOW_EXPERIMENTAL_API',
'-DALLOW_INTERNAL_API'],
include_directories: includes,
dependencies: deps,
install: false)

0 comments on commit 6325167

Please sign in to comment.