Skip to content

Commit

Permalink
build: remove deprecated Meson functions
Browse files Browse the repository at this point in the history
[ upstream commit e16b972 ]

Starting in meson 0.56, the functions meson.source_root() and
meson.build_root() are deprecated and to be replaced by the [more
descriptive] functions: project_source_root()/global_source_root() and
project_build_root()/global_build_root(). Unfortunately, these new
replacement functions were only added in 0.56 release too, so to use
them we would need version checks for old/new functions to remove the
deprecation warnings.

However, the functions "current_build_dir()" and "current_source_dir()"
remain unaffected by all this, so we can bypass the versioning problem,
by saving off these values to "dpdk_source_root" and "dpdk_build_root"
in the top-level meson.build file

Bugzilla ID: 926

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
bruce-richardson authored and kevintraynor committed Feb 21, 2022
1 parent aa8ad3e commit 4f140c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions doc/api/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk')
# So use a configure option for now.
example = custom_target('examples.dox',
output: 'examples.dox',
command: [generate_examples, join_paths(meson.source_root(), 'examples'), '@OUTPUT@'],
command: [generate_examples, join_paths(dpdk_source_root, 'examples'), '@OUTPUT@'],
depfile: 'examples.dox.d',
install: get_option('enable_docs'),
install_dir: htmldir,
build_by_default: get_option('enable_docs'))

cdata = configuration_data()
cdata.set('VERSION', meson.project_version())
cdata.set('API_EXAMPLES', join_paths(meson.build_root(), 'doc', 'api', 'examples.dox'))
cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api'))
cdata.set('API_EXAMPLES', join_paths(dpdk_build_root, 'doc', 'api', 'examples.dox'))
cdata.set('OUTPUT', join_paths(dpdk_build_root, 'doc', 'api'))
cdata.set('HTML_OUTPUT', 'html')
cdata.set('TOPDIR', meson.source_root())
cdata.set('STRIP_FROM_PATH', ' '.join([meson.source_root(), join_paths(meson.build_root(), 'doc', 'api')]))
cdata.set('TOPDIR', dpdk_source_root)
cdata.set('STRIP_FROM_PATH', ' '.join([dpdk_source_root, join_paths(dpdk_build_root, 'doc', 'api')]))
cdata.set('WARN_AS_ERROR', 'NO')
if get_option('werror')
cdata.set('WARN_AS_ERROR', 'YES')
Expand Down
4 changes: 2 additions & 2 deletions kernel/freebsd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ kmods = ['contigmem', 'nic_uio']
# right now, which allows us to simplify things. We pull in the sourcer
# files from the individual meson.build files, and then use a custom
# target to call make, passing in the values as env parameters.
kmod_cflags = ['-I' + meson.build_root(),
'-I' + join_paths(meson.source_root(), 'config'),
kmod_cflags = ['-I' + dpdk_build_root,
'-I' + join_paths(dpdk_source_root, 'config'),
'-include rte_config.h']

# to avoid warnings due to race conditions with creating the dev_if.h, etc.
Expand Down
8 changes: 4 additions & 4 deletions kernel/linux/kni/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ custom_target('rte_kni',
'M=' + meson.current_build_dir(),
'src=' + meson.current_source_dir(),
' '.join(['MODULE_CFLAGS=', kmod_cflags,'-include '])
+ meson.source_root() + '/config/rte_config.h' +
' -I' + meson.source_root() + '/lib/eal/include' +
' -I' + meson.source_root() + '/lib/kni' +
' -I' + meson.build_root() +
+ dpdk_source_root + '/config/rte_config.h' +
' -I' + dpdk_source_root + '/lib/eal/include' +
' -I' + dpdk_source_root + '/lib/kni' +
' -I' + dpdk_build_root +
' -I' + meson.current_source_dir(),
'modules'] + cross_args,
depends: kni_mkfile,
Expand Down
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ endif

# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
dpdk_source_root = meson.current_source_dir()
dpdk_build_root = meson.current_build_dir()
dpdk_conf = configuration_data()
dpdk_libraries = []
dpdk_static_libraries = []
Expand Down

0 comments on commit 4f140c9

Please sign in to comment.