Skip to content

Commit f8c8e1a

Browse files
committed
cmake, meson: Align Darwin version info with Autotools
1 parent 5f3ca31 commit f8c8e1a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ endif()
411411
set(LIBXML_MINOR_COMPAT 14)
412412
math(EXPR LIBXML_SOVERSION "${LIBXML_MAJOR_VERSION} + ${LIBXML_MINOR_COMPAT}")
413413
math(EXPR LIBXML_AGE "${LIBXML_MINOR_VERSION} - ${LIBXML_MINOR_COMPAT}")
414+
math(EXPR LIBXML_MACHO_COMPAT "${LIBXML_SOVERSION} + 1")
414415
set_target_properties(
415416
LibXml2
416417
PROPERTIES
@@ -420,6 +421,8 @@ set_target_properties(
420421
PREFIX lib
421422
VERSION "${LIBXML_SOVERSION}.${LIBXML_AGE}.${LIBXML_MICRO_VERSION}"
422423
SOVERSION ${LIBXML_SOVERSION}
424+
MACHO_COMPATIBILITY_VERSION ${LIBXML_MACHO_COMPAT}
425+
MACHO_CURRENT_VERSION "${LIBXML_MACHO_COMPAT}.${LIBXML_MICRO_VERSION}"
423426
)
424427

425428
if(MSVC)

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ endforeach
480480
v_min_compat = 14
481481
so_version = v_maj + v_min_compat
482482
age = v_min - v_min_compat
483+
darwin_compat = so_version + 1
483484
xml_lib = library(
484485
'xml2',
485486
files(xml_src),
@@ -489,6 +490,7 @@ xml_lib = library(
489490
install: true,
490491
version: f'@so_version@.@age@.@v_mic@',
491492
soversion: so_version,
493+
darwin_versions: [ darwin_compat, f'@darwin_compat@.@v_mic@' ],
492494
)
493495

494496
dep_inc = include_directories('include')

0 commit comments

Comments
 (0)