summaryrefslogtreecommitdiff
path: root/src/meson.build
diff options
context:
space:
mode:
authorBerke Güzel <berke.guzel@gdh.digital>2026-10-15 12:29:25 +0300
committerBerke Güzel <berke.guzel@gdh.digital>2026-10-15 12:29:25 +0300
commit57ebf3b3238a165c1973ecdf96ba79f95d650fc9 (patch)
tree6c6ee6ee17a32d392d068ded61f7a5483ef73e7a /src/meson.build
parent5f03033b0e211f9ed13e7a1351f9a8f9011ab665 (diff)
Add soversion, version macros, and reserved term_options words
The shared library now carries its major version in the SONAME (libterm.so.0), so an ABI break gets a new file name. The header gains TERM_VERSION, TERM_VERSION_MAJOR/MINOR/PATCH and TERM_VERSION_CODE, and term_version() returns the code the library was built with. A test checks the macros against meson.build's project version and against the runtime value. term_options ends with uint32_t reserved[8]. term_new() returns NULL if a word is nonzero, so later versions can give those words a meaning without misreading a caller's leftover data. All-zero options stay valid. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/meson.build')
-rw-r--r--src/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index 694ee0e..7223caa 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,9 @@
subdir('osc')
+# The SONAME carries the major version. An ABI break bumps it, so an old
+# binary keeps the old library.
+term_soversion = meson.project_version().split('.')[0]
+
# The x86-64 SIMD kernels pick their level at run time (see simd.h), so the
# library needs no ISA flags. -march in c_args sets the lowest level.
term_lib = both_libraries('term',
@@ -23,6 +27,8 @@ term_lib = both_libraries('term',
include_directories: term_private_inc,
dependencies: [m_dep],
gnu_symbol_visibility: 'hidden',
+ version: meson.project_version(),
+ soversion: term_soversion,
install: true
)