Skip to content

Commit f447602

Browse files
committed
cmake: improve check of APNG feature availability
1 parent bb7d72f commit f447602

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

gui/qt/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,15 @@ endif()
285285

286286
find_package(PNG QUIET)
287287
if(PNG_FOUND)
288-
target_compile_definitions(CEmu PRIVATE "PNG_SUPPORT")
289-
target_link_libraries(CEmu PRIVATE PNG::PNG)
288+
include(CheckSymbolExists)
289+
set(CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS})
290+
check_symbol_exists(PNG_WRITE_APNG_SUPPORTED "png.h" HAVE_PROPER_APNG_LIB)
291+
if(HAVE_PROPER_APNG_LIB)
292+
target_compile_definitions(CEmu PRIVATE "PNG_SUPPORT")
293+
target_link_libraries(CEmu PRIVATE PNG::PNG)
294+
else()
295+
message(WARNING "The LibPNG found does not seem to support APNG. APNG capture will not be available")
296+
endif()
290297
else()
291298
message(WARNING "No LibPNG found! APNG capture will not be available")
292299
endif()

0 commit comments

Comments
 (0)