early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,36 @@
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

@@ -0,0 +1,24 @@
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})
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
-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 ${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)
+ 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)

View File

@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77a0f85..4a84ed1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -410,6 +410,8 @@ endif()
# Build the executables if asked for.
if(WEBP_BUILD_ANIM_UTILS
+ OR WEBP_BUILD_WEBPINFO
+ OR WEBP_BUILD_WEBPMUX
OR WEBP_BUILD_CWEBP
OR WEBP_BUILD_DWEBP
OR WEBP_BUILD_GIF2WEBP

View File

@@ -0,0 +1,17 @@
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,13 @@
diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake
index bc0dbc9..381f64a 100644
--- a/cmake/cpu.cmake
+++ b/cmake/cpu.cmake
@@ -97,7 +97,7 @@ foreach(I_SIMD RANGE ${WEBP_SIMD_FLAGS_RANGE})
set(CMAKE_REQUIRED_FLAGS ${SIMD_COMPILE_FLAG})
webp_check_compiler_flag(${WEBP_SIMD_FLAG} ${WEBP_ENABLE_SIMD})
else()
- if(MSVC AND SIMD_ENABLE_FLAGS)
+ if(MSVC AND SIMD_ENABLE_FLAGS AND NOT (CMAKE_GENERATOR_PLATFORM MATCHES "^ARM"))
# The detection for SSE2/SSE4 support under MSVC is based on the compiler
# version so e.g., clang-cl will require flags to enable the assembly.
list(GET SIMD_ENABLE_FLAGS ${I_SIMD} SIMD_COMPILE_FLAG)

37
externals/vcpkg/ports/libwebp/0008-sdl.patch vendored Executable file
View File

@@ -0,0 +1,37 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91a4ba8..10a3f4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -624,11 +624,12 @@ endif()
if(WEBP_BUILD_WEBP_JS)
# wasm2js does not support SIMD.
+ find_package(SDL REQUIRED)
if(NOT WEBP_ENABLE_SIMD)
# JavaScript version
add_executable(webp_js ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
- target_link_libraries(webp_js webpdecoder SDL)
- target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(webp_js webpdecoder ${SDL_LIBRARY})
+ target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR})
set(WEBP_HAVE_SDL 1)
set_target_properties(
webp_js
@@ -641,14 +642,14 @@ if(WEBP_BUILD_WEBP_JS)
# WASM version
add_executable(webp_wasm ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
- target_link_libraries(webp_wasm webpdecoder SDL)
- target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(webp_wasm webpdecoder ${SDL_LIBRARY})
+ target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR})
set_target_properties(
webp_wasm
PROPERTIES LINK_FLAGS "-s WASM=1 \
-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
-s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
- target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
+ target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL WEBP_HAVE_JUST_SDL_H)
target_compile_definitions(webpdspdecode PUBLIC EMSCRIPTEN)
endif()

13
externals/vcpkg/ports/libwebp/0009-glut.patch vendored Executable file
View File

@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0799269..45b3306 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -532,7 +532,7 @@ if(WEBP_BUILD_VWEBP)
target_link_libraries(vwebp
${OPENGL_LIBRARIES}
exampleutil
- ${GLUT_glut_LIBRARY}
+ GLUT::GLUT
imageioutil
webp
webpdemux)

82
externals/vcpkg/ports/libwebp/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,82 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebp
REF v1.2.2
SHA512 04a036b705316ea04add50c9ec2d6d7a8316c710556b97413015d7b8548fe31a8f7f5bf0632e76262ada504dcc35ead20189ee7fcb3cebbe568eb15736ad9a94
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
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
anim WEBP_BUILD_ANIM_UTILS
gif2webp WEBP_BUILD_GIF2WEBP
img2webp WEBP_BUILD_IMG2WEBP
vwebp WEBP_BUILD_VWEBP
vwebp-sdl WEBP_HAVE_SDL
info WEBP_BUILD_WEBPINFO
mux WEBP_BUILD_WEBPMUX
extras WEBP_BUILD_EXTRAS
nearlossless WEBP_NEAR_LOSSLESS
simd WEBP_ENABLE_SIMD
cwebp WEBP_BUILD_CWEBP
dwebp WEBP_BUILD_DWEBP
swap16bitcsp WEBP_ENABLE_SWAP_16BIT_CSP
unicode WEBP_UNICODE
libwebpmux WEBP_BUILD_LIBWEBPMUX
)
if(VCPKG_TARGET_IS_OSX)
if("vwebp" IN_LIST FEATURES OR "extras" IN_LIST FEATURES)
message(FATAL_ERROR "Due to GLUT Framework problems with CMake, at the moment it's not possible to build VWebP or extras on Mac!")
endif()
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME WebP CONFIG_PATH share/WebP/cmake)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_fixup_pkgconfig()
set(BIN_NAMES get_disto gif2webp img2webp vwebp vwebp_sdl webpinfo webpmux webp_quality cwebp dwebp)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/webp/")
foreach(tool ${BIN_NAMES})
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/webp/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
endif()
endforeach()
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/webp")
#No tools
file(GLOB_RECURSE RESULT "${CURRENT_PACKAGES_DIR}/tools/")
list(LENGTH RESULT RES_LEN)
if(RES_LEN EQUAL 0)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

196
externals/vcpkg/ports/libwebp/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,196 @@
{
"name": "libwebp",
"version": "1.2.2",
"description": "WebP codec: library to encode and decode images in WebP format",
"homepage": "https://github.com/webmproject/libwebp",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"unicode"
],
"platform": "windows"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"libwebpmux",
"nearlossless",
"simd"
],
"features": {
"all": {
"description": "enable all features except for swap16bitcsp",
"dependencies": [
{
"name": "libwebp",
"features": [
"anim",
"cwebp",
"dwebp",
"gif2webp",
"img2webp",
"info",
"libwebpmux",
"mux",
"nearlossless",
"simd"
]
},
{
"name": "libwebp",
"features": [
"extras"
],
"platform": "!osx"
},
{
"name": "libwebp",
"features": [
"vwebp-sdl"
],
"platform": "!osx"
}
]
},
"anim": {
"description": "Build animation utilities.",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"img2webp",
"mux"
]
}
]
},
"cwebp": {
"description": "Build the cwebp command line tool."
},
"dwebp": {
"description": "Build the dwebp command line tool."
},
"extras": {
"description": "Build extras.",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"vwebp"
]
},
{
"name": "sdl1",
"platform": "windows"
}
]
},
"gif2webp": {
"description": "Build the gif2webp conversion tool.",
"dependencies": [
"giflib",
{
"name": "libwebp",
"default-features": false,
"features": [
"libwebpmux"
]
}
]
},
"img2webp": {
"description": "Build the img2webp animation tool.",
"dependencies": [
"libjpeg-turbo",
"libpng",
{
"name": "libwebp",
"default-features": false,
"features": [
"libwebpmux"
]
},
"tiff"
]
},
"info": {
"description": "Build the webpinfo command line tool."
},
"libbwebpmux": {
"description": "Obsolete, use feature libwebpmux instead.",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"libwebpmux"
]
}
]
},
"libwebpmux": {
"description": "Build the libwebpmux library"
},
"mux": {
"description": "Build the webpmux command line tool.",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"libwebpmux"
]
}
]
},
"nearlossless": {
"description": "Enable near-lossless encoding"
},
"simd": {
"description": "Enable any SIMD optimization."
},
"swap16bitcsp": {
"description": "Enable byte swap for 16 bit colorspaces."
},
"unicode": {
"description": "Build Unicode executables. (Adds definition UNICODE and _UNICODE)"
},
"vwebp": {
"description": "Build the vwebp viewer tool.",
"dependencies": [
{
"name": "freeglut",
"platform": "!osx"
},
"opengl"
]
},
"vwebp-sdl": {
"description": "Build the vwebp viewer tool.",
"dependencies": [
{
"name": "libwebp",
"default-features": false,
"features": [
"vwebp"
]
},
{
"name": "sdl1",
"platform": "windows"
}
]
}
}
}