externals: allow user to use system lodepng (#7138)

This commit is contained in:
Castor215 2023-11-08 23:39:24 +00:00 committed by GitHub
parent ee372572a6
commit fcc0fd671a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View file

@ -327,7 +327,13 @@ if (ENABLE_WEB_SERVICE)
endif()
# lodepng
add_subdirectory(lodepng)
if(USE_SYSTEM_LODEPNG)
add_library(lodepng INTERFACE)
find_package(lodepng REQUIRED)
target_link_libraries(lodepng INTERFACE lodepng::lodepng)
else()
add_subdirectory(lodepng)
endif()
# (xperia64): Only use libyuv on Android b/c of build issues on Windows and mandatory JPEG
if(ANDROID)