Skip to content

Commit

Permalink
move versionscript block to zlib definition
Browse files Browse the repository at this point in the history
superseeds madler#966
  • Loading branch information
Vollstrecker committed Dec 1, 2024
1 parent 2cfba4d commit 25e7113
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ if(ZLIB_BUILD_SHARED)
SOVERSION 1
PROPERTIES OUTPUT_NAME z
PROPERTIES OUTPUT_NAME_DEBUG z${zlib_debug_suffix})
if(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib PROPERTIES
LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
endif(ZLIB_BUILD_SHARED)

if(ZLIB_BUILD_STATIC)
Expand All @@ -188,16 +193,6 @@ if(NOT CYGWIN AND ZLIB_BUILD_SHARED)
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()

if(UNIX)
# On unix-like platforms the library is almost always called libz
if(ZLIB_BUILD_SHARED)
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES
LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
endif(ZLIB_BUILD_SHARED)
endif()

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
if(ZLIB_BUILD_SHARED)
install(TARGETS zlib
Expand Down

0 comments on commit 25e7113

Please sign in to comment.