build: enable a developer mode setting

To allow support for additional build checks and tests only really
relevant for developers, we add support for a developer mode option to
DPDK. The default, "auto", value for this enables developer mode if a
".git" folder is found at the root of the source tree - as was the case
with the previous "make" build system. There is also support for
explicitly enabling or disabling this option using "meson configure" if
so desired.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Bruce Richardson 2021-02-25 15:29:01 +00:00 committed by Thomas Monjalon
parent af68c1d699
commit bc46174338
3 changed files with 24 additions and 0 deletions

View File

@ -798,6 +798,14 @@ Integrating with the Build System
DPDK is built using the tools ``meson`` and ``ninja``.
.. note::
In order to catch possible issues as soon as possible,
it is recommended that developers build DPDK in "developer mode" to enable additional checks.
By default, this mode is enabled if the build is being done from a git checkout,
but the mode can be manually enabled/disabled using the
``developer_mode`` meson configuration option.
Therefore all new component additions should include a ``meson.build`` file,
and should be added to the component lists in the ``meson.build`` files in the
relevant top-level directory:

View File

@ -11,6 +11,20 @@ project('DPDK', 'C',
meson_version: '>= 0.47.1'
)
# check for developer mode
developer_mode = false
if get_option('developer_mode').auto()
if meson.version().version_compare('>=0.53') # fs module available
fs = import('fs')
developer_mode = fs.is_dir('.git')
endif
else
developer_mode = get_option('developer_mode').enabled()
endif
if developer_mode
message('## Building in Developer Mode ##')
endif
# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
dpdk_conf = configuration_data()

View File

@ -2,6 +2,8 @@
option('check_includes', type: 'boolean', value: false,
description: 'build "chkincs" to verify each header file can compile alone')
option('developer_mode', type: 'feature',
description: 'turn on additional build checks relevant for DPDK developers')
option('disable_drivers', type: 'string', value: '',
description: 'Comma-separated list of drivers to explicitly disable.')
option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',