1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
4 doxygen = find_program('doxygen', required: get_option('enable_docs'))
10 # due to the CSS customisation script, which needs to run on a file that
11 # is in a subdirectory that is created at build time and thus it cannot
12 # be an individual custom_target, we need to wrap the doxygen call in a
13 # script to run the CSS modification afterwards
14 generate_doxygen = py3 + files('generate_doxygen.py')
15 generate_examples = py3 + files('generate_examples.py')
17 htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk')
19 # due to the following bug: https://github.com/mesonbuild/meson/issues/4107
20 # if install is set to true it will override build_by_default and it will
21 # cause the target to always be built. If install were to be always set to
22 # false it would be impossible to install the docs.
23 # So use a configure option for now.
24 example = custom_target('examples.dox',
25 output: 'examples.dox',
26 command: [generate_examples, join_paths(dpdk_source_root, 'examples'), '@OUTPUT@'],
27 depfile: 'examples.dox.d',
28 install: get_option('enable_docs'),
30 build_by_default: get_option('enable_docs'))
32 cdata = configuration_data()
33 cdata.set('VERSION', meson.project_version())
34 cdata.set('API_EXAMPLES', join_paths(dpdk_build_root, 'doc', 'api', 'examples.dox'))
35 cdata.set('OUTPUT', join_paths(dpdk_build_root, 'doc', 'api'))
36 cdata.set('HTML_OUTPUT', 'html')
37 cdata.set('TOPDIR', dpdk_source_root)
38 cdata.set('STRIP_FROM_PATH', ' '.join([dpdk_source_root, join_paths(dpdk_build_root, 'doc', 'api')]))
39 cdata.set('WARN_AS_ERROR', 'NO')
40 if get_option('werror')
41 cdata.set('WARN_AS_ERROR', 'YES')
44 doxy_conf = configure_file(input: 'doxy-api.conf.in',
45 output: 'doxy-api.conf',
48 doxy_build = custom_target('doxygen',
50 depend_files: 'doxy-api-index.md',
54 command: [generate_doxygen, '@OUTPUT@', doxygen, '@INPUT@'],
55 install: get_option('enable_docs'),
57 build_by_default: get_option('enable_docs'))
59 doc_targets += doxy_build
60 doc_target_names += 'Doxygen_API'