-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libwebp] Update to 1.3.0, misc changes (#29165)
* [libwebp] Update to 1.3.0 * Fix [core] on x64-osx * Fix features and dependencies * Cleanup tool installation * Usage * Lift restriction for vwebp tool * [mapnik] Fix libwebp * [qt5-imageformats] Use libwebp pc files * Revert "Lift restriction for vwebp tool" This reverts commit 42e0273. * [gdal] Use upstream WebP config * Revert no longer necessary changes to mapnik. * Remove unnecessary patch that git checkout didn't remove. --------- Co-authored-by: Billy Robert O'Neal III <[email protected]>
- Loading branch information
1 parent
6b3a1a2
commit 91dd61b
Showing
17 changed files
with
154 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if(GDAL_USE_WEBP) | ||
find_package(WebP CONFIG REQUIRED) | ||
add_library(WEBP::WebP ALIAS WebP::webp) | ||
set(GDAL_CHECK_PACKAGE_WebP_NAMES WebP CACHE INTERNAL "vcpkg") | ||
set(GDAL_CHECK_PACKAGE_WebP_TARGETS WebP::webp CACHE INTERNAL "vcpkg") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
diff --git a/cmake/WebPConfig.cmake.in b/cmake/WebPConfig.cmake.in | ||
index 822fc59..fb31829 100644 | ||
index f334739..43f10e0 100644 | ||
--- a/cmake/WebPConfig.cmake.in | ||
+++ b/cmake/WebPConfig.cmake.in | ||
@@ -5,7 +5,19 @@ set(WEBP_VERSION ${WebP_VERSION}) | ||
@@ -12,5 +12,12 @@ include ("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
|
||
+include(CMakeFindDependencyMacro) | ||
+find_dependency(Threads) | ||
include ("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
|
||
-set(WebP_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@") | ||
+get_filename_component(_vcpkg_libwebp_root "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) | ||
+set(WebP_INCLUDE_DIRS "${_vcpkg_libwebp_root}/include") | ||
set(WebP_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@") | ||
set(WEBP_INCLUDE_DIRS ${WebP_INCLUDE_DIRS}) | ||
-set(WebP_LIBRARIES "@INSTALLED_LIBRARIES@") | ||
+set(WebP_LIBRARIES "") | ||
+include(SelectLibraryConfigurations) | ||
+foreach(_vcpkg_libwebp_lib IN ITEMS @INSTALLED_LIBRARIES@) | ||
+ string(REPLACE "libwebpmux" "webpmux" _vcpkg_libwebp_lib "${_vcpkg_libwebp_lib}") # offical OUTPUT_NAME | ||
+ find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_RELEASE NAMES ${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${_vcpkg_libwebp_root}/lib" NO_DEFAULT_PATH) | ||
+ find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_DEBUG NAMES ${_vcpkg_libwebp_lib}d ${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${_vcpkg_libwebp_root}/debug/lib" NO_DEFAULT_PATH) | ||
+foreach(_vcpkg_libwebp_lib IN ITEMS @INSTALLED_LIBRARIES@ sharpyuv) | ||
+ find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_RELEASE NAMES ${_vcpkg_libwebp_lib} lib${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${VCPKG_IMPORT_PREFIX}/lib" NO_DEFAULT_PATH) | ||
+ find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_DEBUG NAMES ${_vcpkg_libwebp_lib}d lib${_vcpkg_libwebp_lib}d ${_vcpkg_libwebp_lib} lib${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${VCPKG_IMPORT_PREFIX}/debug/lib" NO_DEFAULT_PATH) | ||
+ select_library_configurations(_vcpkg_${_vcpkg_libwebp_lib}) | ||
+ list(APPEND WebP_LIBRARIES ${_vcpkg_${_vcpkg_libwebp_lib}_LIBRARIES}) | ||
+endforeach() | ||
set(WEBP_LIBRARIES "${WebP_LIBRARIES}") | ||
+unset(_vcpkg_libwebp_root) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,21 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 43742c7f7..44b035ebb 100644 | ||
index 636eef7..80361f1 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -248,6 +248,9 @@ ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h") | ||
if(MSVC) | ||
# avoid security warnings for e.g., fopen() used in the examples. | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
+ if(BUILD_SHARED_LIBS) | ||
+ add_definitions("-DWEBP_DLL") | ||
+ endif() | ||
else() | ||
add_definitions(-Wall) | ||
@@ -452,6 +452,7 @@ endif() | ||
if(WEBP_BUILD_ANIM_UTILS | ||
OR WEBP_BUILD_CWEBP | ||
OR WEBP_BUILD_DWEBP | ||
+ OR WEBP_BUILD_EXTRAS | ||
OR WEBP_BUILD_GIF2WEBP | ||
OR WEBP_BUILD_IMG2WEBP | ||
OR WEBP_BUILD_VWEBP | ||
@@ -488,6 +489,8 @@ if(WEBP_BUILD_ANIM_UTILS | ||
TARGET exampleutil imageioutil imagedec imageenc | ||
PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src | ||
${CMAKE_CURRENT_BINARY_DIR}/src) | ||
+ target_include_directories(imagedec PRIVATE ${WEBP_DEP_IMG_INCLUDE_DIRS}) | ||
+ target_include_directories(imageenc PRIVATE ${WEBP_DEP_IMG_INCLUDE_DIRS}) | ||
endif() | ||
@@ -635,8 +638,12 @@ if(WEBP_BUILD_EXTRAS) | ||
# webp_quality | ||
add_executable(webp_quality ${WEBP_QUALITY_SRCS}) | ||
target_link_libraries(webp_quality exampleutil imagedec extras) | ||
+ if(BUILD_SHARED_LIBS) | ||
+ target_link_libraries(webp_quality webpdspdecode) | ||
+ endif() | ||
target_include_directories(webp_quality | ||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} | ||
+ ${CMAKE_CURRENT_SOURCE_DIR}/src | ||
${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
# vwebp_sdl | ||
@@ -651,6 +658,10 @@ if(WEBP_BUILD_EXTRAS) | ||
${SDL_INCLUDE_DIR}) | ||
set(WEBP_HAVE_SDL 1) | ||
target_compile_definitions(vwebp_sdl PUBLIC WEBP_HAVE_SDL) | ||
+ if (MSVC) | ||
+ target_link_libraries(vwebp_sdl dxguid winmm) | ||
+ endif() | ||
+ target_compile_definitions(vwebp_sdl PRIVATE WEBP_HAVE_JUST_SDL_H) | ||
endif() | ||
endif() | ||
|
||
@@ -669,7 +680,7 @@ if(WEBP_BUILD_WEBP_JS) | ||
-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \ | ||
-s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") | ||
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp) | ||
- target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL) | ||
+ target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL WEBP_HAVE_JUST_SDL_H) | ||
endif() | ||
|
||
# WASM version | ||
diff --git a/src/webp/types.h b/src/webp/types.h | ||
index 47f7f2b00..a7a706590 100644 | ||
--- a/src/webp/types.h | ||
+++ b/src/webp/types.h | ||
@@ -39,7 +39,9 @@ typedef long long int int64_t; | ||
#ifndef WEBP_EXTERN | ||
// This explicitly marks library functions and allows for changing the | ||
// signature for e.g., Windows DLL builds. | ||
-# if defined(__GNUC__) && __GNUC__ >= 4 | ||
+# if defined(_MSC_VER) && defined(WEBP_DLL) | ||
+# define WEBP_EXTERN extern __declspec(dllexport) | ||
+# elif defined(__GNUC__) && __GNUC__ >= 4 | ||
# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) | ||
# else | ||
# define WEBP_EXTERN extern | ||
if(WEBP_BUILD_DWEBP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
libwebp provides CMake targets: | ||
|
||
find_package(WebP CONFIG REQUIRED) | ||
# basic usage | ||
target_link_libraries(main PRIVATE WebP::webp WebP::webpdecoder WebP::webpdemux) | ||
# for manipulating the WebP graphics format container (port feature libwebpmux) | ||
target_link_libraries(main PRIVATE WebP::libwebpmux) | ||
# for sharp RGB to YUV conversion | ||
target_link_libraries(main PRIVATE WebP::sharpyuv) |
Oops, something went wrong.