[libwebp] update to 1.2.3 (#25959)

* libwebp update to 1.2.3

* v db

* fix missing libwebp target

* v db

* add find_dependency(Threads)

* v db

* include the macro

* v db

* Add license

* update version

Co-authored-by: Jonliu1993 <13720414433@163.com>
This commit is contained in:
Alexander Neumann 2022-07-29 00:16:30 +02:00 committed by GitHub
parent 6691c1a042
commit cf2e61b0f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 60 deletions

View File

@ -1,36 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd1bebb..4ce801d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,6 +214,9 @@ endfunction()
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_EXTERN=__declspec(dllexport)" "-DWEBP_DLL")
+ endif()
else()
add_definitions(-Wall)
endif()
@@ -586,8 +589,12 @@ if(WEBP_BUILD_EXTRAS)
# webp_quality
add_executable(webp_quality ${WEBP_QUALITY_SRCS} ${WEBP_EXTRAS_SRCS})
target_link_libraries(webp_quality exampleutil imagedec)
+ 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
@@ -620,7 +627,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

View File

@ -2,8 +2,10 @@ diff --git a/cmake/WebPConfig.cmake.in b/cmake/WebPConfig.cmake.in
index 822fc59..fb31829 100644
--- a/cmake/WebPConfig.cmake.in
+++ b/cmake/WebPConfig.cmake.in
@@ -5,7 +5,17 @@ set(WEBP_VERSION ${WebP_VERSION})
@@ -5,7 +5,19 @@ set(WEBP_VERSION ${WebP_VERSION})
+include(CMakeFindDependencyMacro)
+find_dependency(Threads)
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
-set(WebP_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")

View File

@ -1,17 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83edb3a..f634094 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -540,7 +540,11 @@ if(WEBP_BUILD_EXTRAS)
find_package(SDL)
if(SDL_FOUND)
add_executable(vwebp_sdl ${VWEBP_SDL_SRCS})
- target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
+ target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
+ if (MSVC)
+ target_link_libraries(vwebp_sdl dxguid winmm)
+ endif()
+ target_compile_definitions(vwebp_sdl PRIVATE WEBP_HAVE_JUST_SDL_H)
target_include_directories(vwebp_sdl
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}

View File

@ -0,0 +1,62 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43742c7f7..44b035ebb 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)
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

View File

@ -1,17 +1,16 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebp
REF v1.2.2
SHA512 04a036b705316ea04add50c9ec2d6d7a8316c710556b97413015d7b8548fe31a8f7f5bf0632e76262ada504dcc35ead20189ee7fcb3cebbe568eb15736ad9a94
REF v1.2.3
SHA512 27f86817350e6d0e215c449665046df8c63203344f9a2846770af292ce8fee486a72adfd5e1122aa67e7d2f3e3972cd8423da95fee7edf10c9848bcbda46264c
HEAD_REF master
PATCHES
0001-build.patch
0002-cmake-config.patch
0003-fix-tool-dependencies.patch
0006-fix-dependecies-platform.patch
0007-fix-arm-build.patch
0008-sdl.patch
0009-glut.patch
0010-fix_build.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -80,3 +79,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
# For compatibility
file(READ "${CURRENT_PACKAGES_DIR}/share/WebP/WebPTargets.cmake" contents)
string(APPEND contents "
if(NOT TARGET WebP::libwebpmux)
add_library(WebP::libwebpmux INTERFACE IMPORTED)
set_target_properties(WebP::libwebpmux PROPERTIES INTERFACE_LINK_LIBRARIES WebP::webpmux)
endif()
")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/WebP/WebPTargets.cmake" "${contents}")

View File

@ -1,8 +1,9 @@
{
"name": "libwebp",
"version": "1.2.2",
"version": "1.2.3",
"description": "WebP codec: library to encode and decode images in WebP format",
"homepage": "https://github.com/webmproject/libwebp",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "libwebp",

View File

@ -4245,7 +4245,7 @@
"port-version": 1
},
"libwebp": {
"baseline": "1.2.2",
"baseline": "1.2.3",
"port-version": 0
},
"libwebsockets": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e2b9421b3093512c54494cf01a3fd6edb7424e02",
"version": "1.2.3",
"port-version": 0
},
{
"git-tree": "bf8ec989a234ddde96494e4e07d0ffd93df82151",
"version": "1.2.2",