f28cfd3cd4d31eac275303e9d91e21bcff9911f2
[dpdk.git] / buildtools / chkincs / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2021 Intel Corporation
3
4 if not get_option('check_includes')
5         build = false
6         subdir_done()
7 endif
8
9 if is_windows
10         # for windows, the shebang line in the script won't work.
11         error('option "check_includes" is not supported on windows')
12 endif
13
14 gen_c_file_for_header = find_program('gen_c_file_for_header.py')
15 gen_c_files = generator(gen_c_file_for_header,
16         output: '@BASENAME@.c',
17         arguments: ['@INPUT@', '@OUTPUT@'])
18
19 cflags = machine_args
20 cflags += '-DALLOW_EXPERIMENTAL_API'
21
22 sources = files('main.c')
23 sources += gen_c_files.process(dpdk_chkinc_headers)
24
25 deps = []
26 foreach l:enabled_libs
27         deps += get_variable('static_rte_' + l)
28 endforeach
29
30 executable('chkincs', sources,
31         c_args: cflags,
32         include_directories: includes,
33         dependencies: deps,
34         link_whole: dpdk_static_libraries + dpdk_drivers,
35         install: false)