aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-12-08 12:00:33 +0100
committerSimon Ser <contact@emersion.fr>2023-12-08 12:00:33 +0100
commitfe6f380f2653751e95be6f99922d10bea1327145 (patch)
treed7f49deb20d53c719ab186283f8e74172e900d49 /meson.build
parent425f5c07fb87e2d3ee1bcb71a49d81b7c84c65ef (diff)
build: automatically compute soversion
Instead of requiring a manual soversion bump each time we do a release, automatically compute it from the version number. In the early days we used to not bump soversion, so there is an hardcoded offset. This will need to be updated once we ship 1.0, so assert that we're still on 0.x.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build10
1 files changed, 5 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 682d6962..5f7950c9 100644
--- a/meson.build
+++ b/meson.build
@@ -11,11 +11,11 @@ project(
],
)
-# When doing a major or minor release, *always* increase soversion. This isn't
-# necessary for bugfix releases. Increasing soversion is required because
-# wlroots never guarantees ABI stability -- only API stability is guaranteed
-# between minor releases.
-soversion = 13
+version = meson.project_version().split('-')[0]
+version_major = version.split('.')[0]
+version_minor = version.split('.')[1]
+assert(version_major == '0')
+soversion = version_minor.to_int() - 5
little_endian = target_machine.endian() == 'little'
big_endian = target_machine.endian() == 'big'