Comments (10)
I'd even say the patch isfit for upstreaming. The steps don't look too hard: https://github.com/webmproject/libwebp/blob/main/CONTRIBUTING.md#sending-patches
Done. (Pulled my hair a lot when trying to upload but figured it out eventually.)
from sdl_image.
I may be wrong about the whole tree: sharpyuv is certainly affected though.
EDIT: Yes, looks like only sharpyuv is affected..
from sdl_image.
@madebr: Is the following correct?
diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake
index 7513ca8..20ae612 100644
--- a/cmake/cpu.cmake
+++ b/cmake/cpu.cmake
@@ -107,6 +107,7 @@ foreach(I_SIMD RANGE ${WEBP_SIMD_FLAGS_RANGE})
# Check which files we should include or not.
list(GET WEBP_SIMD_FILE_EXTENSIONS ${I_SIMD} WEBP_SIMD_FILE_EXTENSION)
file(GLOB SIMD_FILES "${CMAKE_CURRENT_LIST_DIR}/../"
+ "sharpyuv/*${WEBP_SIMD_FILE_EXTENSION}"
"src/dsp/*${WEBP_SIMD_FILE_EXTENSION}")
if(WEBP_HAVE_${WEBP_SIMD_FLAG})
# Memorize the file and flags.
from sdl_image.
Adding sources won't do anything, as the linker can resolve all missing links right now.
Does the following patch fix your intel issue?
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,20 @@ if(WIN32)
option(WEBP_UNICODE "Build Unicode executables." ON)
endif()
+set(WEBP_HAVE_SSE2 0)
+set(WEBP_HAVE_SSE41 0)
+include(CheckCCompilerFlag)
+check_c_compiler_flag("-msse2" COMPILER_SUPPORTS_-msse2)
+if(COMPILER_SUPPORTS_-msse2)
+ set(WEBP_HAVE_SSE2 1)
+ add_compile_options(-msse2)
+ check_c_compiler_flag("-msse4.1" COMPILER_SUPPORTS_-msse4.1)
+ if(COMPILER_SUPPORTS_-msse4.1)
+ set(WEBP_HAVE_SSE41 1)
+ add_compile_options(-msse4.1)
+ endif()
+endif()
+
if(WEBP_BUILD_WEBP_JS)
set(WEBP_BUILD_ANIM_UTILS OFF)
from sdl_image.
No, that's not the issue. The part of the cmake'ry I referenced above does check for simd sources and adds the necessary simd compiler flags if available, but it does so only for the ones under src/dsp/. Adding sharpyuv/ glob there does fix the issue; however I am not sure whether or not it is correct in terms of cmake, i.e. I am not sure what the file(GLOB ....)
does with "${CMAKE_CURRENT_LIST_DIR}/../"
: Should it instead be like the following??
diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake
index 7513ca8..c2fae13 100644
--- a/cmake/cpu.cmake
+++ b/cmake/cpu.cmake
@@ -106,8 +106,9 @@ foreach(I_SIMD RANGE ${WEBP_SIMD_FLAGS_RANGE})
endif()
# Check which files we should include or not.
list(GET WEBP_SIMD_FILE_EXTENSIONS ${I_SIMD} WEBP_SIMD_FILE_EXTENSION)
- file(GLOB SIMD_FILES "${CMAKE_CURRENT_LIST_DIR}/../"
- "src/dsp/*${WEBP_SIMD_FILE_EXTENSION}")
+ file(GLOB SIMD_FILES
+ "${CMAKE_CURRENT_LIST_DIR}/../sharpyuv/*${WEBP_SIMD_FILE_EXTENSION}"
+ "${CMAKE_CURRENT_LIST_DIR}/../src/dsp/*${WEBP_SIMD_FILE_EXTENSION}")
if(WEBP_HAVE_${WEBP_SIMD_FLAG})
# Memorize the file and flags.
foreach(FILE ${SIMD_FILES})
from sdl_image.
Yes, your change is fine. When I compile with -DCMAKE_C_FLAGS="-m32 -march=i486"
, and add
#else
#error no sse2
#endif
to sharpyuv/sharpyuv_sse2.c
, it fails to build.
With your changes, it builds.
from sdl_image.
With your changes, it builds.
Thanks. But, which patch is the correct one? Is it the one from #423 (comment) or the one from #423 (comment) ?
from sdl_image.
I tested both, and they both work.
The cpu.cmake
script sets variables, that are used by the main CMakeLists.txt
.
What matters is that the paths are relative to this main script.
That said, the 2nd approach is safer.
Alternatively, you can also do:
+ file(GLOB SIMD_FILES
+ "${PROJECT_SOURE_DIR}/sharpyuv/*${WEBP_SIMD_FILE_EXTENSION}"
+ "${PROJECT_SOURE_DIR}/src/dsp/*${WEBP_SIMD_FILE_EXTENSION}")
PROJECT_SOURCE_DIR
is the folder of the most recent call to project
.
from sdl_image.
OK, applied my second patch for now. Please feel free to revise / improve further.
from sdl_image.
I'd even say the patch isfit for upstreaming.
The steps don't look too hard: https://github.com/webmproject/libwebp/blob/main/CONTRIBUTING.md#sending-patches
from sdl_image.
Related Issues (20)
- printf format mismatch in "xcf: use SDL_PRIx macros in debug messages"? HOT 2
- SDL2_image.dll.lib', needed by '.exe', missing and no known rule to make it
- [cmake] Allow configuring SDL_image with options whose 3rd party dependencies are not available HOT 1
- Build libavif with encoding support on Windows HOT 33
- longjmp/setjmp clobbered warning in IMG_png.c HOT 24
- upgrading libjpeg to 9f HOT 1
- [Cmake] [SDL2] Backport SDL3IMAGE_STRICT option to SDL2_image HOT 3
- cmake build: SDL2IMAGE_DEPS_SHARED option doesn't work HOT 3
- SEGMENTATION FAULT with IMG_Load_RW in SDL2 HOT 4
- Build fails on MSYS2 HOT 4
- Failure to build SDL3_image HOT 4
- [2.8.x] Double-free if IMG_SaveJPG_RW_jpeglib() fails and IMG_SaveJPG_RW_tinyjpeg() is tried HOT 4
- Failing to save a JPEG with libjpeg crashes when it uses an uninitialized jmp_buf HOT 1
- [2.x] Autotools build can detect the wrong libjpeg HOT 10
- Factor out the parts of IMG_LoadJPG_RW where locals can be clobbered by setjmp()/longjmp()
- `SDL_RWops_renamed_SDL_IOStream` with latest SDL3 commit
- Create SDL3 stub library (.tbd) for use by the xcode projects of SDL satellite libraries
- CMake configure error on install with libavif with FetchContent on main (for SDL3) HOT 1
- Statically linking an executable with JPEG XL enabled breaks the build at link time HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl_image.