Skip to content

Commit

Permalink
Update zlib cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Jun 25, 2023
1 parent 377ceef commit 5ba0ceb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions third_party/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.4.4)
cmake_minimum_required(VERSION 3.0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(zlib C)
Expand Down Expand Up @@ -150,13 +150,13 @@ endif(MINGW)

add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})

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

target_include_directories(zlibstatic SYSTEM BEFORE PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
Expand Down

0 comments on commit 5ba0ceb

Please sign in to comment.