File tree Expand file tree Collapse file tree 17 files changed +93
-0
lines changed Expand file tree Collapse file tree 17 files changed +93
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ add_library(ggml-base
211211 ggml-quants.h
212212 gguf.cpp)
213213
214+ set_target_properties (ggml-base PROPERTIES
215+ VERSION ${GGML_VERSION}
216+ SOVERSION ${GGML_VERSION_MAJOR}
217+ )
218+
214219target_include_directories (ggml-base PRIVATE .)
215220if (GGML_BACKEND_DL)
216221 target_compile_definitions (ggml-base PUBLIC GGML_BACKEND_DL)
@@ -220,6 +225,11 @@ add_library(ggml
220225 ggml-backend-reg.cpp)
221226add_library (ggml::ggml ALIAS ggml)
222227
228+ set_target_properties (ggml PROPERTIES
229+ VERSION ${GGML_VERSION}
230+ SOVERSION ${GGML_VERSION_MAJOR}
231+ )
232+
223233if (GGML_BACKEND_DIR)
224234 if (NOT GGML_BACKEND_DL)
225235 message (FATAL_ERROR "GGML_BACKEND_DIR requires GGML_BACKEND_DL" )
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ if (BLAS_FOUND)
1515 ggml-blas.cpp
1616 )
1717
18+ set_target_properties (ggml-blas PROPERTIES
19+ VERSION ${GGML_VERSION}
20+ SOVERSION ${GGML_VERSION_MAJOR}
21+ )
22+
1823 if (${GGML_BLAS_VENDOR} MATCHES "Apple" )
1924 add_compile_definitions (ACCELERATE_NEW_LAPACK)
2025 add_compile_definitions (ACCELERATE_LAPACK_ILP64)
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ if (CANN_INSTALL_DIR)
6969 file (GLOB GGML_SOURCES_CANN "*.cpp" )
7070
7171 ggml_add_backend_library(ggml-cann ${GGML_SOURCES_CANN} )
72+
73+ set_target_properties (ggml-cann PROPERTIES
74+ VERSION ${GGML_VERSION}
75+ SOVERSION ${GGML_VERSION_MAJOR}
76+ )
77+
7278 target_link_libraries (ggml-cann PRIVATE ${CANN_LIBRARIES} )
7379 target_include_directories (ggml-cann PRIVATE ${CANN_INCLUDE_DIRS} )
7480 target_link_directories (ggml-cann PRIVATE ${CANN_INSTALL_DIR} /lib64)
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
2121
2222 ggml_add_backend_library(${GGML_CPU_NAME} )
2323
24+ set_target_properties (${GGML_CPU_NAME} PROPERTIES
25+ VERSION ${GGML_VERSION}
26+ SOVERSION ${GGML_VERSION_MAJOR}
27+ )
28+
2429 list (APPEND GGML_CPU_SOURCES
2530 ggml-cpu/ggml-cpu.c
2631 ggml-cpu/ggml-cpu.cpp
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ if (CUDAToolkit_FOUND)
7171 ${GGML_SOURCES_CUDA}
7272 )
7373
74+ set_target_properties (ggml-cuda PROPERTIES
75+ VERSION ${GGML_VERSION}
76+ SOVERSION ${GGML_VERSION_MAJOR}
77+ )
78+
7479 add_compile_definitions (GGML_CUDA_PEER_MAX_BATCH_SIZE=${GGML_CUDA_PEER_MAX_BATCH_SIZE} )
7580
7681 if (GGML_CUDA_GRAPHS)
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ set(TARGET_NAME ggml-hexagon)
3131ggml_add_backend_library(${TARGET_NAME}
3232 ggml-hexagon.cpp htp-utils.c htp-utils.h ../../include /ggml-hexagon.h)
3333
34+ set_target_properties (${TARGET_NAME} PROPERTIES
35+ VERSION ${GGML_VERSION}
36+ SOVERSION ${GGML_VERSION_MAJOR}
37+ )
38+
3439target_link_libraries (${TARGET_NAME} PRIVATE htp_iface)
3540target_include_directories (${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} /htp ${CMAKE_CURRENT_BINARY_DIR} )
3641
Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ ggml_add_backend_library(ggml-hip
8181 ${GGML_SOURCES_ROCM}
8282 )
8383
84+ set_target_properties (ggml-hip PROPERTIES
85+ VERSION ${GGML_VERSION}
86+ SOVERSION ${GGML_VERSION_MAJOR}
87+ )
88+
8489# TODO: do not use CUDA definitions for HIP
8590if (NOT GGML_BACKEND_DL)
8691 target_compile_definitions (ggml PUBLIC GGML_USE_CUDA)
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ ggml_add_backend_library(ggml-metal
1313 ggml-metal-ops.cpp
1414 )
1515
16+ set_target_properties (ggml-metal PROPERTIES
17+ VERSION ${GGML_VERSION}
18+ SOVERSION ${GGML_VERSION_MAJOR}
19+ )
20+
1621target_link_libraries (ggml-metal PRIVATE
1722 ${FOUNDATION_LIBRARY}
1823 ${METAL_FRAMEWORK}
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ if (MUSAToolkit_FOUND)
7070 ${GGML_SOURCES_MUSA}
7171 )
7272
73+ set_target_properties (ggml-musa PROPERTIES
74+ VERSION ${GGML_VERSION}
75+ SOVERSION ${GGML_VERSION_MAJOR}
76+ )
77+
7378 # TODO: do not use CUDA definitions for MUSA
7479 if (NOT GGML_BACKEND_DL)
7580 target_compile_definitions (ggml PUBLIC GGML_USE_CUDA)
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ set(TARGET_NAME ggml-opencl)
66ggml_add_backend_library(${TARGET_NAME}
77 ggml-opencl.cpp
88 ../../include /ggml-opencl.h)
9+
10+ set_target_properties (${TARGET_NAME} PROPERTIES
11+ VERSION ${GGML_VERSION}
12+ SOVERSION ${GGML_VERSION_MAJOR}
13+ )
14+
915target_link_libraries (${TARGET_NAME} PRIVATE ${OpenCL_LIBRARIES} )
1016target_include_directories (${TARGET_NAME} PRIVATE ${OpenCL_INCLUDE_DIRS} )
1117
You can’t perform that action at this time.
0 commit comments