From 54637a615dcdac20f1f61a017d3bae429aa389e4 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 18 Oct 2021 10:29:41 +0100 Subject: utils: gen-version: Pass the meson source root to the gen-version.sh script The gen-version.sh script expects to be called from a git repo, and sets its src_root variable accordingly. This may not always be the case if it is built from a tarball source - full support for which is in a future commit. The MESON_SOURCE_ROOT environnement variable does not get set when called from the meson vcs_tag() function, but does when called from the run_command() function, so that cannot be used either. Instead, explicitly pass the meson source root to the gen-version.sh script. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/libcamera/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 243dd3c1..6727a777 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -95,7 +95,9 @@ libcamera_sources += control_sources gen_version = meson.source_root() / 'utils' / 'gen-version.sh' -version_cpp = vcs_tag(command : [gen_version, meson.build_root()], +# 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_cpp = vcs_tag(command : [gen_version, meson.build_root(), meson.source_root()], input : 'version.cpp.in', output : 'version.cpp', fallback : meson.project_version()) -- cgit v1.2.1