From 3ac85a6c4ee44573f6d8932d9d5d1bc3351f81db Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Mon, 18 Aug 2025 20:18:07 +0900 Subject: [PATCH 2/3] cmake: Set the same soname as Makefile.am (#168) In Makefile.am, soname is set to 1:0:0, but in CMake it is set to 0:0:0. This means that when building with CMake, libraries with different sonames will be built. This will not maintain library compatibility. This sets the same soname in cmake as well. Before: ``` $ mkdir t && cd t && cmake .. && make $ ls *.so* libbzip3.so libbzip3.so.0 libbzip3.so.0.0.0 $ objdump -p libbzip3.so SONAME libbzip3.so.0.0.0 $ cd .. && autoreconf -ivf && ./configure && make $ ls .libs/*.so* .libs/libbzip3.so .libs/libbzip3.so.1 .libs/libbzip3.so.1.0.0 $ objdump -p ./.libs/libbzip3.so | grep SONAME SONAME libbzip3.so.1 ``` After: ``` $ mkdir t && cd t && cmake .. && make $ ls *.so* libbzip3.so libbzip3.so.1 libbzip3.so.1.0.0 $ objdump -p libbzip3.so SONAME libbzip3.so.1 ``` Signed-off-by: Nobuhiro Iwamatsu --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf6499c..262a792 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,9 +82,9 @@ endif() set_target_properties( bz3 PROPERTIES OUTPUT_NAME bzip3 - SOVERSION "0.0.0" + SOVERSION "1" PUBLIC_HEADER include/libbz3.h - VERSION "0") + VERSION "1.0.0") if(BUILD_SHARED_LIBS) set_target_properties(bz3 PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() -- 2.50.1