diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index f30e4ac9020fa..628db3fd65575 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -211,6 +211,11 @@ add_library(ggml-base ggml-quants.h gguf.cpp) +set_target_properties(ggml-base PROPERTIES + VERSION ${GGML_VERSION} + SOVERSION ${GGML_VERSION_MAJOR} +) + target_include_directories(ggml-base PRIVATE .) if (GGML_BACKEND_DL) target_compile_definitions(ggml-base PUBLIC GGML_BACKEND_DL) @@ -220,6 +225,11 @@ add_library(ggml ggml-backend-reg.cpp) add_library(ggml::ggml ALIAS ggml) +set_target_properties(ggml PROPERTIES + VERSION ${GGML_VERSION} + SOVERSION ${GGML_VERSION_MAJOR} +) + if (GGML_BACKEND_DIR) if (NOT GGML_BACKEND_DL) message(FATAL_ERROR "GGML_BACKEND_DIR requires GGML_BACKEND_DL") @@ -259,6 +269,12 @@ function(ggml_add_backend_library backend) target_compile_definitions(${backend} PUBLIC GGML_BACKEND_SHARED) endif() + # Set versioning properties for all backend libraries + set_target_properties(${backend} PROPERTIES + VERSION ${GGML_VERSION} + SOVERSION ${GGML_VERSION_MAJOR} + ) + if(NOT GGML_AVAILABLE_BACKENDS) set(GGML_AVAILABLE_BACKENDS "${backend}" CACHE INTERNAL "List of backends for cmake package") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 630b2cddf67e8..6fc5b00101058 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -132,6 +132,11 @@ add_library(llama models/graph-context-mamba.cpp ) +set_target_properties(llama PROPERTIES + VERSION ${LLAMA_INSTALL_VERSION} + SOVERSION 0 +) + target_include_directories(llama PRIVATE .) target_include_directories(llama PUBLIC ../include) target_compile_features (llama PRIVATE cxx_std_17) # don't bump diff --git a/tools/mtmd/CMakeLists.txt b/tools/mtmd/CMakeLists.txt index 2381012a0d02f..f640ae2a6ea5f 100644 --- a/tools/mtmd/CMakeLists.txt +++ b/tools/mtmd/CMakeLists.txt @@ -13,6 +13,11 @@ add_library(mtmd mtmd-helper.h ) +set_target_properties(mtmd PROPERTIES + VERSION ${LLAMA_INSTALL_VERSION} + SOVERSION 0 +) + target_link_libraries (mtmd PUBLIC ggml llama) target_link_libraries (mtmd PRIVATE Threads::Threads) target_include_directories(mtmd PUBLIC .)