Skip to content

Commit 8fb32c0

Browse files
committed
Work around fussy zlib on macOS
1 parent b3e7390 commit 8fb32c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,14 @@ if(ENABLE_STATIC)
681681
endif()
682682

683683
if(PNG_SUPPORTED)
684+
if (APPLE)
685+
find_package(ZLIB REQUIRED) # macos doesn't have static zlib
686+
endif()
684687
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
685688
find_package(PNG 1.6 REQUIRED)
686-
find_package(ZLIB REQUIRED)
689+
if (NOT APPLE)
690+
find_package(ZLIB REQUIRED)
691+
endif()
687692
target_include_directories(cjpeg-static PUBLIC ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
688693
target_link_libraries(cjpeg-static ${PNG_LIBRARY} ${ZLIB_LIBRARY})
689694
endif()

0 commit comments

Comments
 (0)