[libwebp] Fix SIMD patch quirks (#32985)

This commit is contained in:
Kai Pastor 2023-08-08 20:28:38 +02:00 committed by GitHub
parent ad58514d64
commit 3a30230788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 24 deletions

View File

@ -0,0 +1,23 @@
diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake
index 7513ca8..38ec73b 100644
--- a/cmake/cpu.cmake
+++ b/cmake/cpu.cmake
@@ -50,7 +50,7 @@ if(MSVC AND CMAKE_C_COMPILER_ID STREQUAL "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1800 AND NOT CMAKE_C_FLAGS MATCHES "/arch:")
set(SIMD_ENABLE_FLAGS)
else()
- set(SIMD_ENABLE_FLAGS "/arch:AVX;/arch:SSE2;;;;")
+ set(SIMD_ENABLE_FLAGS ";/arch:SSE2;;;;") # /arch:AVX is too much for SSE4
endif()
set(SIMD_DISABLE_FLAGS)
else()
@@ -110,6 +110,9 @@ foreach(I_SIMD RANGE ${WEBP_SIMD_FLAGS_RANGE})
"src/dsp/*${WEBP_SIMD_FILE_EXTENSION}")
if(WEBP_HAVE_${WEBP_SIMD_FLAG})
# Memorize the file and flags.
+ if("${SIMD_COMPILE_FLAG}" STREQUAL "")
+ set(SIMD_COMPILE_FLAG " ")
+ endif()
foreach(FILE ${SIMD_FILES})
list(APPEND WEBP_SIMD_FILES_TO_INCLUDE ${FILE})
list(APPEND WEBP_SIMD_FLAGS_TO_INCLUDE ${SIMD_COMPILE_FLAG})

View File

@ -1,22 +0,0 @@
diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake
index bc0dbc9..f9b7327 100644
--- a/cmake/cpu.cmake
+++ b/cmake/cpu.cmake
@@ -48,7 +48,7 @@ if(MSVC AND CMAKE_C_COMPILER_ID STREQUAL "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1800 AND NOT CMAKE_C_FLAGS MATCHES "/arch:")
set(SIMD_ENABLE_FLAGS)
else()
- set(SIMD_ENABLE_FLAGS "/arch:AVX;/arch:SSE2;;;;")
+ set(SIMD_ENABLE_FLAGS "/arch:SSE2;;;;;")
endif()
set(SIMD_DISABLE_FLAGS)
else()
@@ -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 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)

View File

@ -6,7 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0002-cmake-config.patch
0007-fix-arm-build.patch
0003-simd.patch
0008-sdl.patch
0010-fix_build.patch
)

View File

@ -1,6 +1,7 @@
{
"name": "libwebp",
"version": "1.3.1",
"port-version": 1,
"description": "WebP codec: library to encode and decode images in WebP format",
"homepage": "https://github.com/webmproject/libwebp",
"license": "BSD-3-Clause",

View File

@ -4798,7 +4798,7 @@
},
"libwebp": {
"baseline": "1.3.1",
"port-version": 0
"port-version": 1
},
"libwebsockets": {
"baseline": "4.3.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "42095edcaa6f9fb7a29822896d45b772f694a9cf",
"version": "1.3.1",
"port-version": 1
},
{
"git-tree": "3a14f8bd920b63d510d85da200f0b6f1847e270a",
"version": "1.3.1",