diff --git a/CMakeLists.txt b/CMakeLists.txt index aa9b78c6a..181778ecf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,8 +245,15 @@ add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code # libwebp if(ENABLE_WEBP) - set(WEBP_LIBRARIES webp webpdemux libwebpmux) - set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src) + # Use libwebp from Skia + if(LAF_BACKEND STREQUAL "skia") + find_library(WEBP_LIBRARIES webp + PATH "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH) + set(WEBP_INCLUDE_DIR "${SKIA_DIR}/third_party/externals/libwebp/src") + else() + set(WEBP_LIBRARIES webp webpdemux libwebpmux) + set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src) + endif() include_directories(${WEBP_INCLUDE_DIR}) endif() @@ -351,6 +358,8 @@ if(ENABLE_DRM) endif() add_subdirectory(laf) +message(STATUS "aseprite libwebp: ${WEBP_LIBRARIES}") + # LAF libraries + Aseprite are compiled with config.h target_include_directories(laf-base PUBLIC src) target_compile_definitions(laf-base PUBLIC HAVE_CONFIG_H) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 33dc66026..38b91ba9e 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -33,7 +33,7 @@ if(NOT USE_SHARED_GIFLIB) add_subdirectory(giflib) endif() -if(ENABLE_WEBP) +if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia") set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.") set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.") set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")