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

cpp-redis: allow build as shared library #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ottigeda
Copy link

It would be very helpful if we could build this library as a shared library (*.so).

Copy link

@lindblandro lindblandro left a comment

Choose a reason for hiding this comment

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

Unnecessary if-else construct.

@@ -141,7 +141,14 @@ configure_file("cpp_redis.pc.in" "${CMAKE_PKGCONFIG_OUTPUT_DIRECTORY}/cpp_redis.
###
# executable
###
if (BUILD_SHARED_LIBS)

Choose a reason for hiding this comment

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

This is already a global CMake option that overrides the default behavior of add_library() if present.

set(BUILD_SHARED_LIBS ON)
add_library(${PROJECT} ${SOURCES})

will build a shared library. The SOVERSION property will need to be added for symlinks to be generated at install time, but the properties can be set even if BUILD_SHARED_LIBS is not set. A valid value for SOVERSION might be the same as VERSION or just PROJECT_VERSION_MAJOR

See https://cmake.org/cmake/help/v3.13/variable/BUILD_SHARED_LIBS.html

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.

2 participants