summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2022-10-01 00:28:23 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-10-13 12:40:23 +0100
commit0aac297afd0cf2748c20f919bdd8d5e390b8d9a8 (patch)
treeae960b5c71a356fa8b1075c6dcae27edd28e6585 /meson.build
parentcfe30ec54f586a54a24612125402b57b2263bdc9 (diff)
meson: Shared Object version handling
The libcamera project is not yet ready to declare ABI nor API stability, but it will benefit the community to be able to provide more regular release cycles to determine 'versioned' points of history. Ideally, these releases will be made at any ABI breakage, but can be made at arbitary time based points along the way. To support releases which may not be ABI stable, declare the soversion of both the libcamera and libcamera-base library to be dependant upon both the major minor and patch component of the project version. As part of this, introduce a new 'Versions' summary section to highlight the different version components that may become apparent within any given build. Bumping versions may leave dangling libcamera.so.* symlinks in build directories. This will confuse Doxygen which will print during its directory scanning phase a warning that the symlink can't be read. As we don't need Doxygen to follow symlinks, disable it with EXCLUDE_SYMLINKS. Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 32 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 2c6173b4..d8a951a1 100644
--- a/meson.build
+++ b/meson.build
@@ -26,6 +26,38 @@ endif
libcamera_version = libcamera_git_version.split('+')[0]
+# A shallow clone, or a clone without a reachable tag equivalent to the
+# meson.project_version() could leave the project in a mis-described state.
+# Produce a warning in this event, and fix to a best effort.
+if libcamera_version != meson.project_version()
+ warning('The sources disagree about the version: '
+ + libcamera_version + ' != ' + meson.project_version())
+
+ summary({'libcamera git version' : libcamera_git_version,
+ 'Source version match' : false,
+ },
+ bool_yn : true, section : 'Versions')
+
+ libcamera_git_version = libcamera_git_version.replace(libcamera_version,
+ meson.project_version())
+ libcamera_version = meson.project_version()
+
+ # Append a marker to show we have modified this version string
+ libcamera_git_version += '-nvm'
+endif
+
+# Until we make ABI compatible releases, the full libcamera version is used as
+# the soname. No ABI/API compatibility is guaranteed between releases (x.y.z).
+#
+# When automatic ABI based detection is used to increment the version, this
+# will bump the minor number (x.y).
+#
+# When we declare a stable ABI/API we will provide a 1.0 release and the
+# soversion at that point will be the 'major' release value (x).
+libcamera_soversion = libcamera_version
+
+summary({ 'Sources': libcamera_git_version, }, section : 'Versions')
+
# This script generates the .tarball-version file on a 'meson dist' command.
meson.add_dist_script('utils/run-dist.sh')