[libjxl] Remove libm dependency when building with MSVC - #46177
Conversation
|
Is it possible to add a test for this? |
|
@microsoft-github-policy-service agree |
|
The build failures appear legitimate. Perhaps the |
5dccc42 to
5480647
Compare
5480647 to
43e8f0e
Compare
Billy O'Neal (BillyONeal)
left a comment
There was a problem hiding this comment.
Thanks for the fix!
| -else() | ||
| - set(JPEGXL_REQUIRES_TYPE "Requires") | ||
| - set(JPEGXL_PUBLIC_LIBS "-lm ${PKGCONFIG_CXX_LIB}") | ||
| +# MSVCRT bundles math functions |
There was a problem hiding this comment.
Can you submit this patch to https://github.com/libjxl/libjxl/pulls ?
There was a problem hiding this comment.
IMO the change is incorrect: JPEGXL_REQUIRES_TYPE should be set regardless of MSVC.
There was a problem hiding this comment.
There was a problem hiding this comment.
IMO the change is incorrect: JPEGXL_REQUIRES_TYPE should be set regardless of MSVC.
Sigh; you're right and I missed this :/
|
Unfortunately, this also needs to patch up lib/jxl_cms.cmake and lib/threads/libjxl_threads.pc.in, or otherwise the linking against libm sneaks in via those routes. |
This patches MSVC builds to not link with
libm. Otherwise, whenNOT BUILD_SHARED_LIBSis true, targets that depend on the libjxl target try to link withm.lib.The following was the previous workaround I had to do before this fix:
./vcpkg x-add-version --alland committing the result.