From 06cd0c843741ab42a45c6a926f6279675e07c56e Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 1 Feb 2021 23:23:19 -0500 Subject: [PATCH] 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") --- library/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 776a7de76..fd6c1c460 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -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)