meson: Use new project_*_root() functions

meson.source_root() and meson.build_root() are deprecated. Use
meson.project_source_root() and meson.project_build_root() instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Tomi Valkeinen 2022-05-09 13:10:18 +03:00 committed by Kieran Bingham
parent 68fd4b3c91
commit 1ddda31f14
5 changed files with 13 additions and 13 deletions

View file

@ -12,8 +12,8 @@ dot = find_program('dot', required : get_option('documentation'))
if doxygen.found() and dot.found() if doxygen.found() and dot.found()
cdata = configuration_data() cdata = configuration_data()
cdata.set('VERSION', 'v@0@'.format(libcamera_git_version)) cdata.set('VERSION', 'v@0@'.format(libcamera_git_version))
cdata.set('TOP_SRCDIR', meson.source_root()) cdata.set('TOP_SRCDIR', meson.project_source_root())
cdata.set('TOP_BUILDDIR', meson.build_root()) cdata.set('TOP_BUILDDIR', meson.project_build_root())
doxyfile = configure_file(input : 'Doxyfile.in', doxyfile = configure_file(input : 'Doxyfile.in',
output : 'Doxyfile', output : 'Doxyfile',

View file

@ -25,8 +25,8 @@ ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module',
output : core_mojom_file + '-module', output : core_mojom_file + '-module',
command : [ command : [
mojom_parser, mojom_parser,
'--output-root', meson.build_root(), '--output-root', meson.project_build_root(),
'--input-root', meson.source_root(), '--input-root', meson.project_source_root(),
'--mojoms', '@INPUT@' '--mojoms', '@INPUT@'
]) ])
@ -89,8 +89,8 @@ foreach file : ipa_mojom_files
depends : ipa_mojom_core, depends : ipa_mojom_core,
command : [ command : [
mojom_parser, mojom_parser,
'--output-root', meson.build_root(), '--output-root', meson.project_build_root(),
'--input-root', meson.source_root(), '--input-root', meson.project_source_root(),
'--mojoms', '@INPUT@' '--mojoms', '@INPUT@'
]) ])

View file

@ -17,8 +17,8 @@ project('libcamera', 'c', 'cpp',
# git version tag, the build metadata (e.g. +211-c94a24f4) is omitted from # git version tag, the build metadata (e.g. +211-c94a24f4) is omitted from
# libcamera_git_version. # libcamera_git_version.
libcamera_git_version = run_command('utils/gen-version.sh', libcamera_git_version = run_command('utils/gen-version.sh',
meson.build_root(), meson.project_build_root(),
meson.source_root()).stdout().strip() meson.project_source_root()).stdout().strip()
if libcamera_git_version == '' if libcamera_git_version == ''
libcamera_git_version = meson.project_version() libcamera_git_version = meson.project_version()
endif endif
@ -160,7 +160,7 @@ endif
# Create a symlink from the build root to the source root. This is used when # Create a symlink from the build root to the source root. This is used when
# running libcamera from the build directory to locate resources in the source # running libcamera from the build directory to locate resources in the source
# directory (such as IPA configuration files). # directory (such as IPA configuration files).
run_command('ln', '-fsT', meson.source_root(), meson.build_root() / 'source') run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source')
configure_file(output : 'config.h', configuration : config_h) configure_file(output : 'config.h', configuration : config_h)

View file

@ -100,11 +100,11 @@ endforeach
libcamera_sources += control_sources libcamera_sources += control_sources
gen_version = meson.source_root() / 'utils' / 'gen-version.sh' gen_version = meson.project_source_root() / 'utils' / 'gen-version.sh'
# Use vcs_tag() and not configure_file() or run_command(), to ensure that the # Use vcs_tag() and not configure_file() or run_command(), to ensure that the
# version gets updated with every ninja build and not just at meson setup time. # version gets updated with every ninja build and not just at meson setup time.
version_cpp = vcs_tag(command : [gen_version, meson.build_root(), meson.source_root()], version_cpp = vcs_tag(command : [gen_version, meson.project_build_root(), meson.project_source_root()],
input : 'version.cpp.in', input : 'version.cpp.in',
output : 'version.cpp', output : 'version.cpp',
fallback : meson.project_version()) fallback : meson.project_version())

View file

@ -6,8 +6,8 @@ mojom = custom_target('test_mojom_module',
output : 'test.mojom-module', output : 'test.mojom-module',
command : [ command : [
mojom_parser, mojom_parser,
'--output-root', meson.build_root(), '--output-root', meson.project_build_root(),
'--input-root', meson.source_root(), '--input-root', meson.project_source_root(),
'--mojoms', '@INPUT@' '--mojoms', '@INPUT@'
]) ])