New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[freetype] Fix INTERFACE_LINK_LIBRARIES in exported cmake file #14499
Conversation
set(PKG_CONFIG_REQUIRED_PRIVATE "") | ||
|
||
if (ZLIB_FOUND) | ||
- target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${ZLIB_LIBRARIES} is correct, but it's value is not optimized;...;debug;..., so different values are generated in INTERFACE_LINK_LIBRARIES in freetype-config.cmake, and vcpkg_fixup_cmake_targets deletes the debug freetype-config.cmake, which causes this problem.
We should avoid using the macros provided by cmake's module.
That means ZLIB requires a wrapper to correctly set that value on Linux. You are just dropping a droplet of water on a hot stone with that patch. You might have fixed freetype but all other ports using ZLIB_LIBRARIES
still have the same problem. The root cause ist that ZLIB_LIBRARIES
is not correctly set with debug/optimized keywords and needs fixing on Linux/OSX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${ZLIB_LIBRARIES} is correct, but it's value is not optimized;...;debug;..., so different values are generated in INTERFACE_LINK_LIBRARIES in freetype-config.cmake, and vcpkg_fixup_cmake_targets deletes the debug freetype-config.cmake, which causes this problem.
We should avoid using the macros provided by cmake's module.That means ZLIB requires a wrapper to correctly set that value on Linux. You are just dropping a droplet of water on a hot stone with that patch. You might have fixed freetype but all other ports using
ZLIB_LIBRARIES
still have the same problem. The root cause ist thatZLIB_LIBRARIES
is not correctly set with debug/optimized keywords and needs fixing on Linux/OSX.
This means that all module modes(Find*.cmake
) that call cmake by default have a high probability of this problem. So I think we should deal with it uniformly (by vcpkg, not by port).
Merged as "makes the experience better, but it'd be great to fix the underlying issues" |
In order to prevent this from happening, we at least need to find in POST_CHECK whether there is a release version of the library in |
Fix wrong INTERFACE_LINK_LIBRARIES in freetype-config.cmake:
Fixes #9952.