Skip to content

Pin library soname by setting SOVERSION in CMake - #170

Merged
jkriege2 merged 1 commit into
jkriege2:masterfrom
SokolovValy:soversion-beta2
Sep 23, 2026
Merged

jkriege2 merged 1 commit into
jkriege2:masterfrom
SokolovValy:soversion-beta2

Conversation

@SokolovValy

Copy link
Copy Markdown

Problem

Library targets set only VERSION, not SOVERSION:

     set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")                                                                                                             
                                                                                                                                                                                          
 As a result the linker soname contains the full project version, e.g.                                                                                                                    
 `libJKQTPlotter6.so.5.0.0`. Every minor release changes the soname even                                                                                                                  
 though the ABI is compatible, so dependent applications break after a                                                                                                                    
 routine library update.                                                                                                                                                                  

Solution

 Set `SOVERSION` to the project major version. This produces the standard                                                                                                                 
 chain:                                                                                                                                                                                   
                                                                                                                                                                                          
     libJKQTPlotter6.so       (development symlink)                                                                                                                                       
     libJKQTPlotter6.so.5     (soname, stable within major)                                                                                                                               
     libJKQTPlotter6.so.5.0.0 (real file)                                                                                                                                                 
                                                                                                                                                                                          
 Minor releases (5.0.x) now keep the soname `libJKQTPlotter6.so.5` and                                                                                                                    
 dependent binaries load the updated library without relinking.                                                                                                                           
                                                                                                                                                                                          
 The change is applied in `jkqtplotter_setDefaultLibOptions()`, so all                                                                                                                    
 JKQtPlotter libraries get the soname at once.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Pins library SONAMEs to the project major version so compatible minor releases do not require relinking.

Changes:

  • Sets SOVERSION for all libraries using the shared CMake macro.
  • Preserves the full project version via VERSION.
File Description
cmake/​jkqtplotter_macros.cmake Adds major-version SONAME configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jkriege2
jkriege2 merged commit d9b6f18 into jkriege2:master Sep 23, 2026
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

Successfully merging this pull request may close these issues.

3 participants