@@ -16,8 +16,10 @@ project('libcamera', 'c', 'cpp',
# only. If the source tree isn't under git control, or if it matches the last
# git version tag, the build metadata (e.g. +211-c94a24f4) is omitted from
# libcamera_git_version.
+version_sha_override = get_option('version_sha')
libcamera_git_version = run_command('utils/gen-version.sh',
- meson.build_root()).stdout().strip()
+ meson.build_root(),
+ version_sha_override).stdout().strip()
if libcamera_git_version == ''
libcamera_git_version = meson.project_version()
endif
@@ -58,3 +58,8 @@ option('v4l2',
type : 'boolean',
value : false,
description : 'Compile the V4L2 compatibility layer')
+
+option('version_sha',
+ type : 'string',
+ value : '',
+ description : 'Custom version sha string to use')
@@ -93,9 +93,10 @@ endforeach
libcamera_sources += control_sources
+version_sha_override = get_option('version_sha')
gen_version = meson.source_root() / 'utils' / 'gen-version.sh'
-version_cpp = vcs_tag(command : [gen_version, meson.build_root()],
+version_cpp = vcs_tag(command : [gen_version, meson.build_root(), version_sha_override],
input : 'version.cpp.in',
output : 'version.cpp',
fallback : meson.project_version())
This build option can be used to override the SHA value in the version string generated by utils/gen-version.sh. An override is needed if distributions make libcamera builds outside of the upstream git tree. In these cases, the user can then use the correct SHA value of the upstream tree instead of the local downstream build tree. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> --- meson.build | 4 +++- meson_options.txt | 5 +++++ src/libcamera/meson.build | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-)