Skip to content

Commit 1ab3e4e

Browse files
Fix 'simplify' static libpng
1 parent 3d838ac commit 1ab3e4e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ if (ENABLE_LIBPNG)
106106
target_compile_definitions(sawyer PRIVATE CS_ENABLE_LIBPNG)
107107
find_package(PNG REQUIRED)
108108

109-
if (TARGET PNG::PNG)
110-
target_link_libraries(sawyer PRIVATE PNG::PNG)
109+
if (MSVC AND (${VCPKG_TARGET_TRIPLET} MATCHES "-static$"))
110+
merge_static_libraries(sawyer ${PNG::PNG})
111111
else ()
112-
target_link_libraries(sawyer PRIVATE png)
112+
if (TARGET PNG::PNG)
113+
target_link_libraries(sawyer PRIVATE PNG::PNG)
114+
else ()
115+
target_link_libraries(sawyer PRIVATE png)
116+
endif ()
113117
endif ()
114118
endif ()
115119

0 commit comments

Comments
 (0)