Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SOVERSION to shared library #393

Closed
1 of 4 tasks
badshah400 opened this issue Feb 20, 2024 · 1 comment
Closed
1 of 4 tasks

Add SOVERSION to shared library #393

badshah400 opened this issue Feb 20, 2024 · 1 comment

Comments

@badshah400
Copy link
Contributor

Feature category

  • enhancement - build system
  • enhancement - backends
  • enhancement - documentation
  • enhancement - plot categories

The problem
This is a request to add an SOVERSION to the shared library libmatplot that may only be incremented to indicate breakage or interface changes. According to TLDP,

Every shared library has a special name called the "soname''. The soname has the prefix "lib'', the name of the library, the phrase ".so'', followed by a period and a version number that is incremented whenever the interface changes

The solution I'd like

Ideally the soversion will be the major version, i.e. 1 for matplot++ 1.2.x. This patch does it:

Index: matplotplusplus-1.2.1/source/matplot/CMakeLists.txt
===================================================================
--- matplotplusplus-1.2.1.orig/source/matplot/CMakeLists.txt
+++ matplotplusplus-1.2.1/source/matplot/CMakeLists.txt
@@ -98,7 +98,7 @@ target_include_directories(matplot
     PUBLIC $<BUILD_INTERFACE:${MATPLOT_ROOT_DIR}/source>
            $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
 
-set_target_properties(matplot PROPERTIES VERSION ${PROJECT_VERSION})
+set_target_properties(matplot PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
 
 # Shared library symbol export
 include(GenerateExportHeader)

Alternatives I've considered

NA

Additional context

I am a packager for openSUSE and am working on submitting matplot++ packages to the distro's official repository.

Thanks a lot for your very useful library.

@alandefreitas
Copy link
Owner

Thanks for the issue. Yes. This makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants