Make libz.dylib optional on macOS

Thurin reports that the path specified does not exist on macOS 11.2, and DFHack links successfully without it.

CMake output from the find_package(ZLib) call in /CMakeLists.txt:
Found ZLIB: /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libz.tbd (found suitable version "1.2.11", minimum required is "1.1.2")
develop
lethosor 2021-02-01 23:23:19 -05:00
parent 353b8b71f5
commit 06cd0c8437
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 4 additions and 1 deletions

@ -406,7 +406,10 @@ if(APPLE)
set(ZIP_LIBRARY /usr/lib/libz.dylib)
target_link_libraries(dfhack ${SDL_LIBRARY})
target_link_libraries(dfhack ${CXX_LIBRARY})
target_link_libraries(dfhack ${ZIP_LIBRARY})
if(EXISTS ${ZIP_LIBRARY})
# doesn't exist on macOS 11, but DFHack seems to find the right library there
target_link_libraries(dfhack ${ZIP_LIBRARY})
endif()
target_link_libraries(dfhack ncurses)
set_target_properties(dfhack PROPERTIES VERSION 1.0.0)
set_target_properties(dfhack PROPERTIES SOVERSION 1.0.0)