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 --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index dfed01ba..bd3246eb 100644 --- a/meson.build +++ b/meson.build @@ -17,7 +17,8 @@ project('libcamera', 'c', 'cpp', # git version tag, the build metadata (e.g. +211-c94a24f4) is omitted from # libcamera_git_version. libcamera_git_version = run_command('utils/gen-version.sh', - meson.build_root()).stdout().strip() + meson.build_root(), + meson.source_root()).stdout().strip() if libcamera_git_version == '' libcamera_git_version = meson.project_version() endif -- cgit v1.2.1