mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
Meta: Patch libjxl port to not link with libm when building with msvc
The libjxl port is required to add the `msvc-remove-libm` patch. Otherwise LibGfx attempts to link with 'm.lib' which is not valid for MSVC as the CRT bundles math functions implicitly unlike on Unix
This commit is contained in:
parent
35c34a87c0
commit
2f7a83304f
Notes:
github-actions[bot]
2025-06-27 01:37:55 +00:00
Author: https://github.com/ayeteadoe
Commit: 2f7a83304f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5188
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/stasoid
2 changed files with 25 additions and 0 deletions
24
Meta/CMake/vcpkg/overlay-ports/libjxl/msvc-remove-libm.patch
Normal file
24
Meta/CMake/vcpkg/overlay-ports/libjxl/msvc-remove-libm.patch
Normal 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"
|
|
@ -6,6 +6,7 @@ vcpkg_from_github(
|
|||
HEAD_REF main
|
||||
PATCHES
|
||||
fix-dependencies.patch
|
||||
msvc-remove-libm.patch # https://github.com/microsoft/vcpkg/pull/46177
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue