[libjxl] Remove libm dependency when building with MSVC (#46177)

This commit is contained in:
ayeteadoe 2025-06-27 13:36:56 -07:00 committed by GitHub
parent 813a779e69
commit 0cb95c860e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,24 @@
--- a/lib/jxl.cmake 2024-11-26 05:02:35.000000000 -0800
+++ b/lib/jxl.cmake 2025-06-26 08:37:25.999263200 -0700
@@ -269,12 +269,15 @@
set(JPEGXL_LIBRARY_REQUIRES
"libhwy libbrotlienc libbrotlidec libjxl_cms")
-if (BUILD_SHARED_LIBS)
- set(JPEGXL_REQUIRES_TYPE "Requires.private")
- set(JPEGXL_PRIVATE_LIBS "-lm ${PKGCONFIG_CXX_LIB}")
-else()
- set(JPEGXL_REQUIRES_TYPE "Requires")
- set(JPEGXL_PUBLIC_LIBS "-lm ${PKGCONFIG_CXX_LIB}")
+# MSVCRT bundles math functions
+if(NOT MSVC)
+ if (BUILD_SHARED_LIBS)
+ set(JPEGXL_REQUIRES_TYPE "Requires.private")
+ set(JPEGXL_PRIVATE_LIBS "-lm ${PKGCONFIG_CXX_LIB}")
+ else()
+ set(JPEGXL_REQUIRES_TYPE "Requires")
+ set(JPEGXL_PUBLIC_LIBS "-lm ${PKGCONFIG_CXX_LIB}")
+ endif()
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/jxl/libjxl.pc.in"

View File

@ -6,7 +6,8 @@ vcpkg_from_github(
HEAD_REF main
PATCHES
fix-dependencies.patch
avoid-exe-linker-flags.patch # https://github.com/libjxl/libjxl/pull/4229
avoid-exe-linker-flags.patch # https://github.com/libjxl/libjxl/pull/4229
msvc-remove-libm.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

View File

@ -1,7 +1,7 @@
{
"name": "libjxl",
"version-semver": "0.11.1",
"port-version": 1,
"port-version": 2,
"description": "JPEG XL image format reference implementation",
"homepage": "https://github.com/libjxl/libjxl",
"license": "BSD-3-Clause",
@ -17,6 +17,7 @@
"features": {
"tools": {
"description": "Build user tools: cjxl and djxl",
"supports": "!uwp",
"dependencies": [
"giflib",
"libjpeg-turbo",

View File

@ -4906,7 +4906,7 @@
},
"libjxl": {
"baseline": "0.11.1",
"port-version": 1
"port-version": 2
},
"libkeyfinder": {
"baseline": "2.2.8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1ff477143618a294bb1f624cc075c4ea42059377",
"version-semver": "0.11.1",
"port-version": 2
},
{
"git-tree": "1f7903efa9347e989121781311287edb5f41592f",
"version-semver": "0.11.1",