Skip to content

Commit

Permalink
Fix zlib linking
Browse files Browse the repository at this point in the history
  • Loading branch information
alef committed Jan 16, 2025
1 parent 5e4d0bc commit febed3f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ if (TILES)
install(TARGETS cataclysm-tiles RUNTIME)
endif ()

if (TARGET ZLIB::ZLIB)
target_link_libraries(cataclysm-tiles-common PUBLIC ZLIB::ZLIB)
else()
target_link_libraries(cataclysm-tiles-common PUBLIC ${ZLIB_LIBRARIES})
endif()

endif ()

# Build curses version if requested
Expand Down Expand Up @@ -234,13 +240,14 @@ if (CURSES)
if (RELEASE)
install(TARGETS cataclysm RUNTIME)
endif ()

if (TARGET ZLIB::ZLIB)
target_link_libraries(cataclysm-common PUBLIC ZLIB::ZLIB)
else()
target_link_libraries(cataclysm-common PUBLIC ${ZLIB_LIBRARIES})
endif()
endif ()

if (TARGET ZLIB::ZLIB)
target_link_libraries(cataclysm-common PUBLIC ZLIB::ZLIB)
else()
target_link_libraries(cataclysm-common PUBLIC ${ZLIB_LIBRARIES})
endif()

if (MINGW AND NOT RELEASE)
# Try to Install shared libraries for dev builds
Expand Down

0 comments on commit febed3f

Please sign in to comment.