File: Add-soversion-to-libraries.patch

package info (click to toggle)
ggml 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 17,128 kB
  • sloc: cpp: 107,161; ansic: 36,329; lisp: 9,094; python: 1,558; objc: 1,045; sh: 773; makefile: 59
file content (40 lines) | stat: -rw-r--r-- 1,828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Christian Kastner <ckk@kvr.at>
Date: Sun, 13 Jul 2025 21:14:33 +0200
Subject: Add soversion to libraries

We need to move the build number/install version code around because it
must come before add_subdirectory(src).

Forwarded: not-needed
---
 src/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 594ee39..20813aa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -236,6 +236,7 @@ function(ggml_add_backend_library backend)
         add_library(${backend} MODULE ${ARGN})
         # write the shared library to the output directory
         set_target_properties(${backend} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+        set_target_properties(${backend} PROPERTIES VERSION ${GGML_VERSION} SOVERSION 0)
         target_compile_definitions(${backend} PRIVATE GGML_BACKEND_DL)
         add_dependencies(ggml ${backend})
         if (GGML_BACKEND_DIR)
@@ -245,6 +246,7 @@ function(ggml_add_backend_library backend)
         endif()
     else()
         add_library(${backend} ${ARGN})
+        set_target_properties(${backend} PROPERTIES VERSION ${GGML_VERSION} SOVERSION 0)
         target_link_libraries(ggml PUBLIC ${backend})
         # On Debian, we install the library and headers to a private directory "ggml"
         install(TARGETS ${backend} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ggml)
@@ -415,6 +417,7 @@ endif()
 if (BUILD_SHARED_LIBS)
     foreach (target ggml-base ggml)
         set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+        set_target_properties(${target} PROPERTIES VERSION ${GGML_VERSION} SOVERSION 0)
         target_compile_definitions(${target} PRIVATE GGML_BUILD)
         target_compile_definitions(${target} PUBLIC  GGML_SHARED)
     endforeach()