contrib/leveldb/0005-Restore-soname-versioning-with-CMake-build.patch
2021-10-31 13:08:32 +11:00

33 lines
893 B
Diff

From: leveldb Team <no-reply@google.com>
Date: Mon, 1 Apr 2019 08:59:17 -0700
Subject: [PATCH] Restore soname versioning with CMake build
Before:
$ readelf -d build/libleveldb.so | grep soname
0x000000000000000e (SONAME) Library soname: [libleveldb.so]
After:
$ readelf -d build/libleveldb.so | grep soname
0x000000000000000e (SONAME) Library soname: [libleveldb.so.1]
This matches the soname from v1.20.
PiperOrigin-RevId: 241334113
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8285b8..9de6c3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -259,6 +259,10 @@ if(BUILD_SHARED_LIBS)
# Used by include/export.h.
LEVELDB_SHARED_LIBRARY
)
+ set_target_properties(leveldb
+ PROPERTIES VERSION ${PROJECT_VERSION})
+ set_target_properties(leveldb
+ PROPERTIES SOVERSION 1)
endif(BUILD_SHARED_LIBS)
if(HAVE_CLANG_THREAD_SAFETY)