Merge pull request #2472 from Exiv2/fix_soversion

Fix shared object versioning
main
Miloš Komarčević 2 years ago committed by GitHub
commit b4179adab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,6 +12,15 @@ project(exiv2 # use TWEAK to categorize the build
LANGUAGES C CXX
)
# Shared Object versioning (SemVer-like: must bump major on API breakage)
if(PROJECT_VERSION_MAJOR EQUAL 0)
# support legacy scheme (e.g. 0.27.x -> 27)
set(EXIV2LIB_SOVERSION ${PROJECT_VERSION_MINOR})
else()
# restart from 30
math(EXPR EXIV2LIB_SOVERSION "30 + (${PROJECT_VERSION_MAJOR} - 1)")
endif()
if(NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release)
endif()

@ -32,6 +32,11 @@ exiv_conf = configure_file(output: 'exiv2lib_export.h', configuration: exiv_api)
cdata = configuration_data()
cdata.set('EXV_PACKAGE_NAME', meson.project_name())
ver = meson.project_version().split('.')
if ver[0] == '0'
sover = ver[1].to_int()
else
sover = 30 + (ver[0].to_int() - 1)
endif
cdata.set('PROJECT_VERSION_MAJOR', ver[0])
cdata.set('PROJECT_VERSION_MINOR', ver[1])
cdata.set('PROJECT_VERSION_PATCH', ver[2])
@ -308,6 +313,7 @@ exiv2 = library(
xmp_lib,
cpp_args: cargs,
version: meson.project_version(),
soversion: sover,
gnu_symbol_visibility: 'hidden',
link_with: convertlib,
dependencies: [deps, exiv2int_dep],

@ -160,7 +160,7 @@ endif()
set_target_properties( exiv2lib PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MINOR}
SOVERSION ${EXIV2LIB_SOVERSION}
OUTPUT_NAME exiv2
PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}

Loading…
Cancel
Save