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 SONAME/SOVERSION to generated library #231

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion export/cmake/CMakeLists.txt.export
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ endif()
# shared and static libraries built from the same object files
if (LIBINT2_BUILD_SHARED_AND_STATIC_LIBS)
add_library(libint2 SHARED $<TARGET_OBJECTS:libint2_obj>)
set_target_properties(libint2 PROPERTIES LIBRARY_OUTPUT_NAME int2)
set_target_properties(libint2 PROPERTIES LIBRARY_OUTPUT_NAME int2 VERSION 2.0.4 SOVERSION 2)
Copy link
Owner

Choose a reason for hiding this comment

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

would ${LIBINT_VERSION} would for VERSION?

Choose a reason for hiding this comment

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

As the API/ABI are not strictly controlled for backwards compatibility, the SOVERSION should be the same as the VERSION (better safe than sorry ...). This is the CMake default if SOVERSION is omitted.

set_target_properties(libint2 PROPERTIES
    LIBRARY_OUTPUT_NAME int2
    VERSION ${LIBINT_VERSION}
)

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks. I think SOVERSION 2 is appropriate, the ABI of the library has been stable for many years.

add_library(libint2-static STATIC $<TARGET_OBJECTS:libint2_obj>)
set_target_properties(libint2-static PROPERTIES ARCHIVE_OUTPUT_NAME int2)
target_include_directories(libint2-static INTERFACE
Expand Down