Skip to content

Commit

Permalink
Merge pull request #1057 from orgads/static-name
Browse files Browse the repository at this point in the history
Use the same name for static and shared libraries
  • Loading branch information
michael-grunder authored Jun 26, 2022
2 parents 902dd04 + dd4bf97 commit 8a15f4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ ADD_LIBRARY(hiredis_static STATIC ${hiredis_sources})
ADD_LIBRARY(hiredis::hiredis ALIAS hiredis)
ADD_LIBRARY(hiredis::hiredis_static ALIAS hiredis_static)

IF(NOT MSVC)
SET_TARGET_PROPERTIES(hiredis_static
PROPERTIES OUTPUT_NAME hiredis)
ENDIF()

SET_TARGET_PROPERTIES(hiredis
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
VERSION "${HIREDIS_SONAME}")
Expand Down Expand Up @@ -160,6 +165,10 @@ IF(ENABLE_SSL)
${hiredis_ssl_sources})
ADD_LIBRARY(hiredis_ssl_static STATIC
${hiredis_ssl_sources})
IF(NOT MSVC)
SET_TARGET_PROPERTIES(hiredis_ssl_static
PROPERTIES OUTPUT_NAME hiredis_ssl)
ENDIF()

IF (APPLE)
SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup")
Expand Down

0 comments on commit 8a15f4d

Please sign in to comment.